Skip to content

Commit 599737f

Browse files
authored
Merge branch 'javascript-tutorial:master' into master
2 parents 5777c31 + be8eb1e commit 599737f

17 files changed

Lines changed: 607 additions & 607 deletions

File tree

‎1-js/08-prototypes/03-native-prototypes/1-defer-to-prototype/solution.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Function.prototype.defer = function(ms) {
66
};
77

88
function f() {
9-
alert("Hello!");
9+
alert("Привіт!");
1010
}
1111

12-
f.defer(1000); // shows "Hello!" after 1 sec
12+
f.defer(1000); // показує "Привіт!" через 1 сек
1313
```

‎1-js/08-prototypes/03-native-prototypes/1-defer-to-prototype/task.md‎

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

33
---
44

5-
# Add method "f.defer(ms)" to functions
5+
# Додайте метод "f.defer(ms)" до функцій
66

7-
Add to the prototype of all functions the method `defer(ms)`, that runs the function after `ms` milliseconds.
7+
Додайте до прототипу всіх функцій метод `defer(ms)`, що запускає функцію після `ms` мілісекунд.
88

9-
After you do it, such code should work:
9+
Після цього цей код повинен працювати:
1010

1111
```js
1212
function f() {
13-
alert("Hello!");
13+
alert("Привіт!");
1414
}
1515

16-
f.defer(1000); // shows "Hello!" after 1 second
16+
f.defer(1000); // показує "Привіт!" через 1 секунду
1717
```

‎1-js/08-prototypes/03-native-prototypes/2-defer-to-prototype-extended/solution.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ Function.prototype.defer = function(ms) {
88
}
99
};
1010

11-
// check it
11+
// перевіримо це
1212
function f(a, b) {
1313
alert( a + b );
1414
}
1515

16-
f.defer(1000)(1, 2); // shows 3 after 1 sec
16+
f.defer(1000)(1, 2); // показує 3 після 1 сек
1717
```
1818

19-
Please note: we use `this` in `f.apply` to make our decoration work for object methods.
19+
Будь ласка, зверніть увагу: ми використовуємо `this` в `f.apply`, щоб наше декорування працювало для методів об’єкта.
2020

21-
So if the wrapper function is called as an object method, then `this` is passed to the original method `f`.
21+
Отже, якщо функція-обгортка викликається як метод об’єкта, то `this` передається до оригінального методу `f`.
2222

2323
```js run
2424
Function.prototype.defer = function(ms) {
@@ -29,7 +29,7 @@ Function.prototype.defer = function(ms) {
2929
};
3030

3131
let user = {
32-
name: "John",
32+
name: "Іван",
3333
sayHi() {
3434
alert(this.name);
3535
}

‎1-js/08-prototypes/03-native-prototypes/2-defer-to-prototype-extended/task.md‎

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

33
---
44

5-
# Add the decorating "defer()" to functions
5+
# Додайте декоруючий метод "defer()" до функцій
66

7-
Add to the prototype of all functions the method `defer(ms)`, that returns a wrapper, delaying the call by `ms` milliseconds.
7+
Додати до прототипу всіх функцій метод `defer(ms)`, що повертає обгортку, що затримує виклик на `ms` мілісекунд.
88

9-
Here's an example of how it should work:
9+
Ось приклад того, як метод повинен працювати:
1010

1111
```js
1212
function f(a, b) {
1313
alert( a + b );
1414
}
1515

16-
f.defer(1000)(1, 2); // shows 3 after 1 second
16+
f.defer(1000)(1, 2); // показує 3 після 1 секунди
1717
```
1818

19-
Please note that the arguments should be passed to the original function.
19+
Будь ласка, зверніть увагу, що аргументи повинні бути передані до вихідної функції.

‎1-js/08-prototypes/03-native-prototypes/article.md‎

Lines changed: 68 additions & 68 deletions
Large diffs are not rendered by default.

‎1-js/09-classes/04-private-protected-properties-methods/article.md‎

Lines changed: 101 additions & 101 deletions
Large diffs are not rendered by default.

‎1-js/10-error-handling/2-custom-errors/1-format-error/task.md‎

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

33
---
44

5-
# Inherit from SyntaxError
5+
# Успадкувати від SyntaxError
66

7-
Create a class `FormatError` that inherits from the built-in `SyntaxError` class.
7+
Створіть клас `FormatError`, який успадковується від вбудованого класу `SyntaxError`.
88

9-
It should support `message`, `name` and `stack` properties.
9+
Він повинен підтримувати властивості `message`, `name` та `stack`.
1010

11-
Usage example:
11+
Приклад використання:
1212

1313
```js
1414
let err = new FormatError("formatting error");
@@ -18,5 +18,5 @@ alert( err.name ); // FormatError
1818
alert( err.stack ); // stack
1919

2020
alert( err instanceof FormatError ); // true
21-
alert( err instanceof SyntaxError ); // true (because inherits from SyntaxError)
21+
alert( err instanceof SyntaxError ); // true (оскільки успадковується від SyntaxError)
2222
```

‎1-js/10-error-handling/2-custom-errors/article.md‎

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

‎1-js/11-async/01-callbacks/article.md‎

Lines changed: 73 additions & 73 deletions
Large diffs are not rendered by default.

‎2-ui/1-document/02-dom-nodes/article.md‎

Lines changed: 109 additions & 109 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)