Skip to content

Commit 412f490

Browse files
committed
translate 2-custom-errors
1 parent 54c6205 commit 412f490

File tree

3 files changed

+79
-78
lines changed

3 files changed

+79
-78
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ importance: 5
44

55
# Inherit from SyntaxError
66

7-
Create a class `FormatError` that inherits from the built-in `SyntaxError` class.
7+
Buat kelas `FormatError` yang diwarisi dari bawaan kelas `SyntaxError`.
88

9-
It should support `message`, `name` and `stack` properties.
9+
Ini harus mendukung properti `message`, `name` dan `stack`.
1010

11-
Usage example:
11+
Contoh penggunaan:
1212

1313
```js
14-
let err = new FormatError("formatting error");
14+
let err = new FormatError('formatting error');
1515

16-
alert( err.message ); // formatting error
17-
alert( err.name ); // FormatError
18-
alert( err.stack ); // stack
16+
alert(err.message); // formatting error
17+
alert(err.name); // FormatError
18+
alert(err.stack); // stack
1919

20-
alert( err instanceof FormatError ); // true
21-
alert( err instanceof SyntaxError ); // true (because inherits from SyntaxError)
20+
alert(err instanceof FormatError); // true
21+
alert(err instanceof SyntaxError); // true (karena mewarisi dari SyntaxError)
2222
```

0 commit comments

Comments
 (0)