1.

The object whose properties are inherited by all instances of the class, and properties whose values are functions behaving like instance methods of the class, is _____________(a) Instance object(b) Constructor object(c) Destructor object(d) Prototype objectI had been asked this question by my school principal while I was bunking the class.My question is from Lazy Loading topic in portion Invocation and Performance Navigation of JavaScript

Answer»

Right choice is (d) PROTOTYPE object

Easiest explanation: A prototype is an object that is associated with EVERY functions and object by default in JavaScript, where function’s prototype property is accessible and modifiable and object’s prototype property (aka attribute) is not visible. The properties of the prototype object are inherited by all instances of the class, and properties WHOSE values are functions BEHAVE LIKE instance methods of the class.



Discussion

No Comment Found

Related InterviewSolutions