Quiz
What is a constructor?
It's a function that's called with
new
keyword in front of it. What is a [[Prototype]] and where does it come from?
It's a linkage from one object to another object. It comes from:
Object.create
or as step2 of the new
constructor call.How does a [[Prototype]] affect an object?
We can call a property or method reference on an object and if the engine doesn't find it, it delegates up the prototype chain.
How do we find out where an object's [[Prototype]] points to (3 ways)?
.__proto__
Object.getprototypeOf
.constructor.prototype