javascript-prototypes Flashcards
What kind of inheritance does the JavaScript programming language use?
JavaScript doesn’t use classical inheritance. Instead, it uses prototypal inheritance. In prototypal inheritance, an object “inherits” properties from another object via the prototype linkage.
-https://www.javascripttutorial.net/javascript-prototypal-inheritance/#:~:text=JavaScript%20doesn’t%20use%20classical,object%20via%20the%20prototype%20linkage.
What is a prototype in JavaScript?
an object that contains properties and methods that can be attached to another object
How is it possible to call methods on strings, arrays, and numbers even though those methods don’t actually exist on strings, arrays, and numbers?
If an object does not have it’s own property or method by a given key, where does JavaScript look for it?
The prototype chain