Tell us the difference between classical inheritance and prototypal inheritance?
Submitted by: MuhammadThe great thing about JavaScript is the ability to do away with the rigid rules of classical inheritance and let objects inherit properties from other objects.
☛ Classical Inheritance: A constructor function instantiates an instance via the “new” keyword. This new instance inherits properties from a parent class.
☛ Prototypal Inheritance: An instance is created by cloning an existing object that serves as a prototype. This instance-often instantiated using a factory function or “Object.create()”-can benefit from selective inheritance from many different objects.
Submitted by: Muhammad
☛ Classical Inheritance: A constructor function instantiates an instance via the “new” keyword. This new instance inherits properties from a parent class.
☛ Prototypal Inheritance: An instance is created by cloning an existing object that serves as a prototype. This instance-often instantiated using a factory function or “Object.create()”-can benefit from selective inheritance from many different objects.
Submitted by: Muhammad
Read Online Full-Stack Developer Job Interview Questions And Answers
Top Full-Stack Developer Questions
☺ | Explain me what are the disadvantages of using JavaScript? |
☺ | Explain me which frameworks are you most familiar with? |
☺ | Can you write a function that can determine whether a string is a palindrome in under 100 characters? |
☺ | Tell us are you a team player? Give an example of a time when you had to resolve a conflict with another member on your team? |
☺ | Can you tell me what is starvation? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |