Skip to content

Commit 2bd1854

Browse files
authored
Update solution.md
Wouldn't this solution be more flexible?
1 parent f2501bc commit 2bd1854

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class FormatError extends SyntaxError {
33
constructor(message) {
44
super(message);
5-
this.name = "FormatError";
5+
this.name = this.constructor.name;
66
}
77
}
88

0 commit comments

Comments
 (0)