Module 9 ¡ this, Prototypes and Classes
Under the Hood: the Chain Walked by Hand, instanceof, and How V8 Sees Class Objects
ProReading
Lesson 01 drew the prototype chain as boxes and arrows. That picture is right, but it leaves out three things a working programmer meets sooner or later. A getter found far up the chain still sees the object you started from. instanceof can be told to lie. And the speed of a lookup depends less on how far it climbs than on how much variety one line of code sees.
Checking what this lesson needs for youâĻ
What is inside Under the Hood: the Chain Walked by Hand, instanceof, and How V8 Sees Class Objects
- What the specification says a lookup is
- The chain walked by hand
- What instanceof really checks
- When Symbol.hasInstance changes the answer
- What a lookup up the chain costs
- How V8 treats class objects
- Changing a prototype later