Skip to content

Commit 5e4c86f

Browse files
authored
Update classes-emit.md
1 parent 3c84a7a commit 5e4c86f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/classes-emit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ People rarely have trouble understanding 1, but many people struggle with 2. So
6060

6161
After having tutored many people about this I find the following explanation to be simplest. First we will explain how the code from `__extends` is equivalent to the simple `d.prototype.__proto__ = b.prototype`, and then why this line in itself is significant. To understand all this you need to know these things:
6262
1. `__proto__`
63-
2. `prototype`
64-
3. effect of `new` on `this` inside the called function
65-
4. effect of `new` on `prototype` and `__proto__`
63+
1. `prototype`
64+
1. effect of `new` on `this` inside the called function
65+
1. effect of `new` on `prototype` and `__proto__`
6666

6767
All objects in JavaScript contain a `__proto__` member. This member is often not accessible in older browsers (sometimes documentation refers to this magical property as `[[prototype]]`). It has one objective: If a property is not found on an object during lookup (e.g. `obj.property`) then it is looked up at `obj.__proto__.property`. If it is still not found then `obj.__proto__.__proto__.property` till either: *it is found* or *the latest `.__proto__` itself is null*. This explains why JavaScript is said to support *prototypal inheritance* out of the box. This is shown in the following example, which you can run in the chrome console or nodejs:
6868

0 commit comments

Comments
 (0)