Synthesizing Members Directly on an Instance
Learn how to synthesize members directly on instances of a class instead of a proxy.
We'll cover the following...
The two pillars
Rather than calling proxy.key
, we should be able to perform anyInstanceOfMap.key
. To achieve this, we need to bring two different pieces of knowledge together.
-
First, when a nonexistent property is requested on an object, JavaScript automatically requests it from the object’s prototype. If the prototype does not have it, the search continues through the prototype chain—see Understanding Prototypal Inheritance.
-
Second, a proxy can trap requests ...
Access this course and 1400+ top-rated courses and projects.