How does JavaScript’s prototypal inheritance differ from classical inheritance models?
- JavaScript uses delegation-based inheritance, where objects inherit from other objects directly, not from classes.
- JavaScript uses class-based inheritance like many other programming languages.
- JavaScript's inheritance is more rigid and less flexible compared to classical models.
- JavaScript's inheritance is limited to only built-in objects.
JavaScript's prototypal inheritance differs from classical inheritance models by using delegation-based inheritance. Instead of inheriting from classes, objects inherit directly from other objects, which is more flexible and dynamic.
Loading...
Related Quiz
- In a document-oriented NoSQL database, the ________ defines the structure and data types of the document.
- Which of the following is true regarding the 'this' keyword inside an arrow function?
- What is the significance of the call(), apply(), and bind() methods in JavaScript functions?
- ESLint plugins can be installed and added to the ______ array in the ESLint configuration file.
- Why is it advantageous to use stubbing when dealing with external services or APIs in tests?