up
This commit is contained in:
parent
83b93e5992
commit
9ad9063d00
742 changed files with 884 additions and 779 deletions
18
1-js/08-error-handling/12-oop-errors/1-format-error/task.md
Normal file
18
1-js/08-error-handling/12-oop-errors/1-format-error/task.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# Inherit from SyntaxError
|
||||
|
||||
Create an error `FormatError` that inherits from `SyntaxError`.
|
||||
|
||||
Usage example:
|
||||
```js
|
||||
let err = new FormatError("formatting error");
|
||||
|
||||
alert( err.message ); // formatting error
|
||||
alert( err.name ); // FormatError
|
||||
alert( err.stack ); // stack
|
||||
|
||||
alert( err instanceof SyntaxError ); // true
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue