Update article.md
This commit is contained in:
parent
37f50d8c53
commit
591b5f79f9
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
|
||||
# Static properties and methods
|
||||
|
||||
We can also assign a methods to the class function, not to its `"prototype"`. Such methods are called *static*.
|
||||
We can also assign a method to the class function, not to its `"prototype"`. Such methods are called *static*.
|
||||
|
||||
An example:
|
||||
|
||||
|
@ -125,9 +125,9 @@ Article.publisher = "Ilya Kantor";
|
|||
|
||||
## Statics and inheritance
|
||||
|
||||
Statics are inhereted, we can access `Parent.method` as `Child.method`.
|
||||
Statics are inherited, we can access `Parent.method` as `Child.method`.
|
||||
|
||||
For instance, `Animal.compare` in the code below is inhereted and accessible as `Rabbit.compare`:
|
||||
For instance, `Animal.compare` in the code below is inherited and accessible as `Rabbit.compare`:
|
||||
|
||||
```js run
|
||||
class Animal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue