Skip to content

Commit c62c84c

Browse files
authored
Merge pull request #1492 from hrodward/patch-18
Update article.md
2 parents 9909b90 + 29ea890 commit c62c84c

File tree

1 file changed

+4
-4
lines changed
  • 1-js/08-prototypes/01-prototype-inheritance

1 file changed

+4
-4
lines changed

1-js/08-prototypes/01-prototype-inheritance/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rabbit.__proto__ = animal;
3434
```smart header="`__proto__` is a historical getter/setter for `[[Prototype]]`"
3535
Please note that `__proto__` is *not the same* as `[[Prototype]]`. That's a getter/setter for it.
3636

37-
It exists for historical reasons, in modern language it is replaced with functions `Object.getPrototypeOf/Object.setPrototypeOf` that also get/set the prototype. We'll study the reasons for that and these functions later.
37+
It exists for historical reasons. In modern language it is replaced with functions `Object.getPrototypeOf/Object.setPrototypeOf` that also get/set the prototype. We'll study the reasons for that and these functions later.
3838

3939
By the specification, `__proto__` must only be supported by browsers, but in fact all environments including server-side support it. For now, as `__proto__` notation is a little bit more intuitively obvious, we'll use it in the examples.
4040
```
@@ -203,7 +203,7 @@ Here in the line `(*)` the property `admin.fullName` has a getter in the prototy
203203

204204
## The value of "this"
205205

206-
An interesting question may arise in the example above: what's the value of `this` inside `set fullName(value)`? Where the properties `this.name` and `this.surname` are written: into `user` or `admin`?
206+
An interesting question may arise in the example above: what's the value of `this` inside `set fullName(value)`? Where are the properties `this.name` and `this.surname` written: into `user` or `admin`?
207207

208208
The answer is simple: `this` is not affected by prototypes at all.
209209

@@ -252,7 +252,7 @@ As a result, methods are shared, but the object state is not.
252252

253253
## for..in loop
254254

255-
The `for..in` loops over inherited properties too.
255+
The `for..in` loop iterates over inherited properties too.
256256

257257
For instance:
258258

@@ -267,7 +267,7 @@ let rabbit = {
267267
};
268268

269269
*!*
270-
// Object.keys only return own keys
270+
// Object.keys only returns own keys
271271
alert(Object.keys(rabbit)); // jumps
272272
*/!*
273273

0 commit comments

Comments
 (0)