Skip to content

Commit b6404a6

Browse files
authored
Update article.md
Grammar suggestions
1 parent 33cca1b commit b6404a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

1-js/09-classes/02-class-inheritance/article.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ For instance, to find `rabbit.run` method, the engine checks (bottom-up on the p
6666
2. Its prototype, that is `Rabbit.prototype` (has `hide`, but not `run`).
6767
3. Its prototype, that is (due to `extends`) `Animal.prototype`, that finally has the `run` method.
6868

69-
As we can recall from the chapter <info:native-prototypes>, JavaScript itself uses prototypal inheritance for build-in objects. E.g. `Date.prototype.[[Prototype]]` is `Object.prototype`. That's why dates have access to generic object methods.
69+
As we can recall from the chapter <info:native-prototypes>, JavaScript itself uses prototypal inheritance for built-in objects. E.g. `Date.prototype.[[Prototype]]` is `Object.prototype`. That's why dates have access to generic object methods.
7070

7171
````smart header="Any expression is allowed after `extends`"
7272
Class syntax allows to specify not just a class, but any expression after `extends`.
@@ -181,7 +181,7 @@ setTimeout(function() { super.stop() }, 1000);
181181

182182
With constructors it gets a little bit tricky.
183183

184-
Till now, `Rabbit` did not have its own `constructor`.
184+
Until now, `Rabbit` did not have its own `constructor`.
185185

186186
According to the [specification](https://tc39.github.io/ecma262/#sec-runtime-semantics-classdefinitionevaluation), if a class extends another class and has no `constructor`, then the following "empty" `constructor` is generated:
187187

@@ -245,7 +245,7 @@ The difference is:
245245

246246
So if we're making a constructor of our own, then we must call `super`, because otherwise the object for `this` won't be created. And we'll get an error.
247247

248-
For `Rabbit` constructor to work, it needs to call `super()` before using `this`, like here:
248+
For the `Rabbit` constructor to work, it needs to call `super()` before using `this`, like here:
249249

250250
```js run
251251
class Animal {
@@ -529,4 +529,4 @@ rabbit.eat(); // Error calling super (because there's no [[HomeObject]])
529529
- So it's not safe to copy a method with `super` from one object to another.
530530

531531
Also:
532-
- Arrow functions don't have own `this` or `super`, so they transparently fit into the surrounding context.
532+
- Arrow functions don't have their own `this` or `super`, so they transparently fit into the surrounding context.

0 commit comments

Comments
 (0)