Frontend & browser·JavaScript in the browser
the object did not have the method but calling it worked anyway, because something further up did.
Prototype chain
Also calledprototypal inheritance, __proto__
The chain of objects a property lookup walks when the property is not found directly, ending at `null`. It is the mechanism `class` is built on, and the reason `Object.keys` and a `for...in` loop disagree about what an object contains. It matters most when it bites: an object used as a dictionary inherits `toString` and friends, which is why `Object.create(null)` and `Map` exist.