Skip to content

Commit 2731a82

Browse files
authored
Update task.md
1 parent 5f3f3cd commit 2731a82

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • 1-js/10-error-handling/2-custom-errors/1-format-error

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ 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
14-
let err = new FormatError("formatting error");
14+
let err = new FormatError("ошибка формата");
1515

16-
alert( err.message ); // formatting error
16+
alert( err.message ); // ошибка формата
1717
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
```

0 commit comments

Comments
 (0)