Update article.md
Grammar
This commit is contained in:
parent
30e3fa7237
commit
89c4a0fca9
1 changed files with 3 additions and 3 deletions
|
@ -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`.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue