Sure. It starts at the object and goes up the prototype chain until
it either finds a match (and returns true
) or fails (and
returns false
).
A prototype is an object that every instance is connected to by a
link (implemented as the __proto__
property).
The prototype is the object that stores all the methods, which
means that all instances share the method code. So
both ron's
and harry's
bank account object
use exactly the same functions for deposit
and withdraw
We can also store properties in the prototype, which then all the
instances share. We did this when we put the FDIC
property in the prototype, so all the bank accounts became FDIC
insured.
Great!