File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
1-js/09-classes/02-class-inheritance Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ There's no own constructor in `Rabbit`, so `Animal` constructor is called.
323323
324324What's interesting is that in both cases: ` new Animal() ` and ` new Rabbit() ` , the ` alert ` in the line ` (*) ` shows ` animal ` .
325325
326- ** In other words, parent constructor always uses its own field value, not the overridden one.**
326+ ** In other words, the parent constructor always uses its own field value, not the overridden one.**
327327
328328What's odd about it?
329329
@@ -360,9 +360,9 @@ And that's what we naturally expect. When the parent constructor is called in th
360360
361361...But for class fields it's not so. As said, the parent constructor always uses the parent field.
362362
363- Why is there the difference?
363+ Why is there a difference?
364364
365- Well, the reason is in the field initialization order. The class field is initialized:
365+ Well, the reason is the field initialization order. The class field is initialized:
366366- Before constructor for the base class (that doesn't extend anything),
367367- Immediately after ` super() ` for the derived class.
368368
You can’t perform that action at this time.
0 commit comments