Skip to content

Commit 7a139f3

Browse files
authored
Class inheritance (#218)
1 parent 9696f5e commit 7a139f3

File tree

7 files changed

+212
-212
lines changed

7 files changed

+212
-212
lines changed

1-js/09-classes/02-class-inheritance/1-class-constructor-error/solution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
That's because the child constructor must call `super()`.
1+
Це тому, що конструктор дочірнього классу повинен викликати `super()`.
22

3-
Here's the corrected code:
3+
Ось правильний код:
44

55
```js run
66
class Animal {
@@ -21,7 +21,7 @@ class Rabbit extends Animal {
2121
}
2222

2323
*!*
24-
let rabbit = new Rabbit("White Rabbit"); // ok now
24+
let rabbit = new Rabbit("Білий кролик"); // зараз добре
2525
*/!*
26-
alert(rabbit.name); // White Rabbit
26+
alert(rabbit.name); // Білий кролик
2727
```

1-js/09-classes/02-class-inheritance/1-class-constructor-error/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Error creating an instance
5+
# Помилка створення екземпляра
66

7-
Here's the code with `Rabbit` extending `Animal`.
7+
Ось код з `Rabbit` розширює `Animal`.
88

9-
Unfortunately, `Rabbit` objects can't be created. What's wrong? Fix it.
9+
На жаль, неможливо створити об’єкти `Rabbit`. Що не так? Полагодьте це.
1010
```js run
1111
class Animal {
1212

1-js/09-classes/02-class-inheritance/2-clock-class-extended/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ importance: 5
22

33
---
44

5-
# Extended clock
5+
# Покращений годинник
66

7-
We've got a `Clock` class. As of now, it prints the time every second.
7+
У нас є клас `Clock`. На даний момент він виводить час кожну секунду.
88

99

1010
[js src="source.view/clock.js"]
1111

12-
Create a new class `ExtendedClock` that inherits from `Clock` and adds the parameter `precision` -- the number of `ms` between "ticks". Should be `1000` (1 second) by default.
12+
Створіть новий клас `ExtendedClock`, який успадковує від `Clock` і додає `precision` -- кількість `мс` між "цоканнями". Типово, інтервал повинен бути `1000` (1 секунда).
1313

14-
- Your code should be in the file `extended-clock.js`
15-
- Don't modify the original `clock.js`. Extend it.
14+
- Ваш код повинен бути у файлі `extended-clock.js`
15+
- Не змінюйте оригінал `clock.js`. Розширте його.

1-js/09-classes/02-class-inheritance/article.md

Lines changed: 197 additions & 197 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)