GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix spelling/grammar mistakes on Prototype section · Codecmb/javascript-gitbook@0cf9ee8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objects
    • prototype.md
Expand file treeCollapse file tree
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)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.