JavaScript · Middle · Question 6 of 75

How does the engine look up a property the object itself doesn't have?

Explanation

Every object has a hidden [[Prototype]] link (Object.getPrototypeOf). That's how arrays get map from Array.prototype and all objects get toString from Object.prototype. Scope lookup applies to variables, not properties.

Further reading

Problem with a question

JavaScript · Middle · question 6

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz