File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
1-js/09-classes/03-static-properties-methods Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ rabbits.sort(Rabbit.compare);
169169rabbits[0 ].run (); // Black Rabbit runs with speed 5.
170170```
171171
172- Now when we can call ` Rabbit.compare ` , the inherited ` Animal.compare ` will be called.
172+ Now when we call ` Rabbit.compare ` , the inherited ` Animal.compare ` will be called.
173173
174174How does it work? Again, using prototypes. As you might have already guessed, ` extends ` gives ` Rabbit ` the ` [[Prototype]] ` reference to ` Animal ` .
175175
@@ -180,7 +180,7 @@ So, `Rabbit extends Animal` creates two `[[Prototype]]` references:
1801801 . ` Rabbit ` function prototypally inherits from ` Animal ` function.
1811812 . ` Rabbit.prototype ` prototypally inherits from ` Animal.prototype ` .
182182
183- As the result, inheritance works both for regular and static methods.
183+ As a result, inheritance works both for regular and static methods.
184184
185185Here, let's check that by code:
186186
@@ -197,7 +197,7 @@ alert(Rabbit.prototype.__proto__ === Animal.prototype); // true
197197
198198## Summary
199199
200- Static methods are used for the functionality that belongs to the class "as a whole", doesn't relate to a concrete class instance.
200+ Static methods are used for the functionality that belongs to the class "as a whole". It doesn't relate to a concrete class instance.
201201
202202For example, a method for comparison ` Article.compare(article1, article2) ` or a factory method ` Article.createTodays() ` .
203203
You can’t perform that action at this time.
0 commit comments