Recall & Review
beginner
What is a prototype in JavaScript?
A prototype is an object that other objects inherit properties and methods from. It allows sharing features between objects without copying them.
Click to reveal answer
beginner
Why do JavaScript objects use prototypes?
Prototypes let objects share methods and properties efficiently, saving memory and enabling easy updates to shared behavior.Click to reveal answer
intermediate
How do prototypes help with method sharing?
Instead of each object having its own copy of a method, the method lives on the prototype. Objects access it through the prototype chain.
Click to reveal answer
intermediate
What happens if a property is not found on an object?
JavaScript looks up the prototype chain to find the property. If it exists on the prototype, it is used.
Click to reveal answer
beginner
How do prototypes support code reuse?
By putting shared code on prototypes, many objects can reuse the same code without duplication, making programs smaller and faster.
Click to reveal answer
What is the main purpose of prototypes in JavaScript?
✗ Incorrect
Prototypes allow objects to share properties and methods, avoiding duplication.
If a property is missing on an object, where does JavaScript look next?
✗ Incorrect
JavaScript checks the object's prototype chain to find missing properties.
How do prototypes help save memory?
✗ Incorrect
Methods on prototypes are shared, so each object doesn't need its own copy.
Which of these is true about the prototype chain?
✗ Incorrect
The prototype chain helps locate properties and methods by checking prototypes.
What happens if a property is found on both the object and its prototype?
✗ Incorrect
The object's own property overrides the prototype's property.
Explain why prototypes are important in JavaScript and how they help objects share behavior.
Think about how many objects can use the same method without copying it.
You got /4 concepts.
Describe what happens when you try to access a property that an object does not have directly.
JavaScript looks beyond the object itself.
You got /3 concepts.