Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cf9ee8

Browse filesBrowse files
committed
Fix spelling/grammar mistakes on Prototype section
1 parent 7654944 commit 0cf9ee8
Copy full SHA for 0cf9ee8

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎objects/prototype.md‎

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 numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ To set your own object as a prototype instead of the default Object.prototype, y
3030

3131
```js
3232
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. */
3434
child.age = 8;
3535
/* 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.
3737
Note: adult's age is still 26. */
3838
var stringRepresentation = child.toString();
3939
// 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" */
4141
```
4242

4343
`child`'s prototype is `adult`, whose prototype is `Object.prototype`. This sequence of prototypes is called **prototype chain**.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.