GeezerVison is showing github.com — Fix spelling/grammar mistakes on Prototype section · ufo-github/javascript-2@0cf9ee8
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: objects/prototype.md +3-3Lines changed: 3 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,14 +30,14 @@ To set your own object as a prototype instead of the default Object.prototype, y |
30 | 30 |
|
31 | 31 | ```js |
32 | 32 | var child = Object.create(adult); |
33 | | - /* This way of creating objects lets us easly replace the default Object.prototype with the one we want. In this case, the child's prototype is the adult object. */ |
| 33 | + /* This way of creating objects lets us easily replace the default Object.prototype with the one we want. In this case, the child's prototype is the adult object. */ |
34 | 34 | child.age = 8; |
35 | 35 | /* Previously, child didn't have its own age property, and the interpreter had to look further to the child's prototype to find it. |
36 | | - Now, when we set the child's own age, the interpereter will not go further. |
| 36 | + Now, when we set the child's own age, the interpreter will not go further. |
37 | 37 | Note: adult's age is still 26. */ |
38 | 38 | var stringRepresentation = child.toString(); |
39 | 39 | // The value is "I'm 8". |
40 | | - /* Note: we have not overrided the child's toString property, thus the adult's method will be invoked. If adult did not have toString property, then Object.prototype's toString method would be invoked, and we would get "[object Object]" instead of "I'm 8" */ |
| 40 | + /* Note: we have not overridden the child's toString property, thus the adult's method will be invoked. If adult did not have toString property, then Object.prototype's toString method would be invoked, and we would get "[object Object]" instead of "I'm 8" */ |
41 | 41 | ``` |
42 | 42 |
|
43 | 43 | `child`'s prototype is `adult`, whose prototype is `Object.prototype`. This sequence of prototypes is called **prototype chain**. |