en.javascript.info/1-js/08-error-handling/12-oop-errors/1-format-error/task.md
Ilya Kantor 9ad9063d00 up
2016-11-28 21:35:42 +03:00

337 B

importance: 5


Inherit from SyntaxError

Create an error FormatError that inherits from SyntaxError.

Usage example:

let err = new FormatError("formatting error");

alert( err.message ); // formatting error
alert( err.name ); // FormatError
alert( err.stack ); // stack

alert( err instanceof SyntaxError ); // true