PrepAway - Latest Free Exam Questions & Answers

Which method or operator should you add to the function?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
parentObj.instanceof(testObj)

B.
testObj.isPrototypeOf(parentObj)

C.
testObj.instanceof(parentObj)

D.
parentObj.isPrototypeOf(testObj)

Explanation:

8 Comments on “Which method or operator should you add to the function?

  1. Luk says:

    prototypeObj.isPrototypeOf(obj)
    Parameters

    prototypeObj
    An object to be tested against each link in the prototype chain of the object argument.
    object
    The object whose prototype chain will be searched.




    0



    0

Leave a Reply