Front End Developer (AngularJS) Question:
Download Questions PDF

Tell me what is the difference between a prototype and a class?

Front End Developer (AngularJS) Interview Question
Front End Developer (AngularJS) Interview Question

Answer:

Prototype-based inheritance allows you to create new objects with a single operator; class-based inheritance allows you to create new objects through instantiation. Prototypes are more concrete than classes, as they are examples of objects rather than descriptions of format and instantiation.

Prototypes are important in JavaScript because JavaScript does not have classical inheritance based on classes; all inheritances happen through prototypes. If the JavaScript runtime can’t find an object’s property, it looks to the object’s prototype, and continues up the prototype chain until the property is found.

Download Front End Developer (AngularJS) Interview Questions And Answers PDF

Previous QuestionNext Question
Explain me when would you use CSS clear?Explain me your workflow when you create a web page?