Prototypes and Classes Flashcards
Prototypal inheritance is a feature in JavaScript that allows us to make use of _______ from other ______. Usually these are related but they do not have to be.
Prototypal inheritance is a feature in JavaScript that allows us to make use of code from other objects. Usually these are related but they do not have to be.
Give some examples of prototypal inheritance:
For example, an animal object may possess a name and speak() function. A dog object may possess a licksPerSecond property. A bird object may possess knownWords:[], and fly().
Prototypes allow developers to delegate ________ to other objects.
Prototypes allow developers to delegate behaviours to other objects.
If we have an object that needs functionality from another object, we can create _______ ________ in their own objects and the ________ chain will still remain intact.
If we have an object that needs functionality from another object, we can create unique properties in their own objects and the prototype chain will still remain intact.
Constructors help developers make multiple similar ______ with the same ______ and _______. (Object.create and Object.assign perform similar functionality)
Constructors help developers make multiple similar objects with the same properties and methods. (Object.create and Object.assign perform similar functionality)
With call(), an object can use a ________ belonging to another object.
With call(), an object can use a method belonging to another object.
In classical inheritance, A class is like a ______— a description of the _____ to be created.
In classical inheritance, A class is like a blueprint — a description of the object to be created.
Classes inherit from classes and create subclass relationships: _______ class taxonomies.
Classes inherit from classes and create subclass relationships: hierarchical class taxonomies.
_________ isn’t delegated, it is inherited in a stricter hierarchy.
Functionality isn’t delegated, it is inherited in a stricter hierarchy.
Using ______.assign(), we can simply allow any object to use functionality from another.
Using Object.assign(), we can simply allow any object to use functionality from another.
______ are very flexible and have no class hierarchy.
Mixins are very flexible and have no class hierarchy.
Developers can assign multiple objects to any other _____ or _____.
Developers can assign multiple objects to any other object or prototype.
The _____ object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.
The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.
A “_______” callback function and a “____” callback function may be executed when the operations completes.
A “resolved” callback function and a “reject” callback function may be executed when the operations completes.
We use promises for __________ behaviour.
We use promises for asynchronous behaviour.