You are creating a custom function. You pass an object named testObj to the function as a parameter. You do
not use inheritance through the functions.
The function must establish whether testObj inherits from another object named parentObj.
You need to ensure that the function performs as required.
Which method or operator should you add to the function?

A.
parentObj.instanceof(testObj)
B.
testObj.isPrototypeOf(parentObj)
C.
testObj.instanceof(parentObj)
D.
parentObj.isPrototypeOf(testObj)
Explanation:
The isPrototypeOf() method tests for an object in another object’s prototype chain.
Object.prototype.isPrototypeOf()
D
Parent to child
0
0
parentObject.prototype.isPrototypeOf(testObj);
0
0
This should explain it better https://docs.microsoft.com/en-us/scripting/javascript/reference/isprototypeof-method-object-javascript, but you blokes are correct, it makes sense to check if a child has some attributes of a parent,because a child can inherit from a parent , but a parent will never inherit from a child. keep in mind that this is read LEFT TO RIGHT.
0
0