File tree Expand file tree Collapse file tree 2 files changed +70
-70
lines changed
1-js/10-error-handling/2-custom-errors Expand file tree Collapse file tree 2 files changed +70
-70
lines changed Original file line number Diff line number Diff 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
1414let err = new FormatError (" formatting error" );
@@ -18,5 +18,5 @@ alert( err.name ); // FormatError
1818alert ( err .stack ); // stack
1919
2020alert ( err instanceof FormatError ); // true
21- alert ( err instanceof SyntaxError ); // true (because inherits from SyntaxError)
21+ alert ( err instanceof SyntaxError ); // true (оскільки успадковується від SyntaxError)
2222```
You can’t perform that action at this time.
0 commit comments