File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ Due to the first case `test` now acts like like a plain function call; therefore
95
95
` this ` inside it will no longer refer to ` someObject ` .
96
96
97
97
While the late binding of ` this ` might seem like a bad idea at first, it is in
98
- fact what makes [ prototypical inheritance] ( #object.prototype ) work.
98
+ fact what makes [ prototypal inheritance] ( #object.prototype ) work.
99
99
100
100
function Foo() {}
101
101
Foo.prototype.method = function() {};
Original file line number Diff line number Diff line change 1
1
## The Prototype
2
2
3
3
JavaScript does not feature a classical inheritance model, instead it uses a
4
- * prototypical * one.
4
+ * prototypal * one.
5
5
6
6
While this is often considered to be one of JavaScript's weaknesses, the
7
- prototypical inheritance model is in fact more powerful than the classic model.
7
+ prototypal inheritance model is in fact more powerful than the classic model.
8
8
It is for example fairly trivial to build a classic model on top of it, while the
9
9
other way around is a far more difficult task.
10
10
11
11
Due to the fact that JavaScript is basically the only widely used language that
12
- features prototypical inheritance, it takes some time to adjust to the
12
+ features prototypal inheritance, it takes some time to adjust to the
13
13
differences between the two models.
14
14
15
15
The first major difference is that inheritance in JavaScript is done by using so
@@ -104,7 +104,7 @@ the features of newer JavaScript engines; for example,
104
104
105
105
### In conclusion
106
106
107
- It is a ** must** to understand the prototypical inheritance model completely
107
+ It is a ** must** to understand the prototypal inheritance model completely
108
108
before writing complex code which makes use of it. Also, watch the length of
109
109
the prototype chains and break them up if necessary to avoid possible
110
110
performance issues. Further, the native prototypes should ** never** be extended
You can’t perform that action at this time.
0 commit comments