The _______ pattern allows a new object to be created by cloning an existing object to avoid the overhead of creating an object from scratch.
- Singleton
- Prototype
- Decorator
- Observer
The Prototype pattern allows a new object to be created by cloning an existing object, avoiding the overhead of creating an object from scratch. It involves creating an object as a prototype and then creating new instances by copying that prototype.
Loading...
Related Quiz
- What does a Promise represent in JavaScript?
- You are working with a NodeList after querying the DOM and want to iterate over each node. Which loop would be directly usable without converting the NodeList to an array?
- The data type of NaN in JavaScript is _________.
- What is the impact on performance when using a while loop with a condition that evaluates an expression involving function calls?
- Can a function expression be used before it is defined in the code?