Update article.md

Grammar
This commit is contained in:
hrodward 2019-10-21 12:26:24 +02:00 committed by GitHub
parent 30e3fa7237
commit 89c4a0fca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
Remember, new objects can be created with a constructor function, like `new F()`. Remember, new objects can be created with a constructor function, like `new F()`.
If `F.prototype` is an object, then `new` operator uses it to set `[[Prototype]]` for the new object. If `F.prototype` is an object, then the `new` operator uses it to set `[[Prototype]]` for the new object.
```smart ```smart
JavaScript had prototypal inheritance from the beginning. It was one of the core features of the language. JavaScript had prototypal inheritance from the beginning. It was one of the core features of the language.
@ -158,9 +158,9 @@ Rabbit.prototype = {
In this chapter we briefly described the way of setting a `[[Prototype]]` for objects created via a constructor function. Later we'll see more advanced programming patterns that rely on it. In this chapter we briefly described the way of setting a `[[Prototype]]` for objects created via a constructor function. Later we'll see more advanced programming patterns that rely on it.
Everything is quite simple, just few notes to make things clear: Everything is quite simple, just a few notes to make things clear:
- The `F.prototype` property (don't mess with `[[Prototype]]`) sets `[[Prototype]]` of new objects when `new F()` is called. - The `F.prototype` property (don't mistake it for `[[Prototype]]`) sets `[[Prototype]]` of new objects when `new F()` is called.
- The value of `F.prototype` should be either an object or `null`: other values won't work. - The value of `F.prototype` should be either an object or `null`: other values won't work.
- The `"prototype"` property only has such a special effect when set on a constructor function, and invoked with `new`. - The `"prototype"` property only has such a special effect when set on a constructor function, and invoked with `new`.