Skip to content

Commit fef2e00

Browse files
author
tegarjgap
committed
translating into Indonesian
1 parent 3ef687d commit fef2e00

File tree

3 files changed

+140
-146
lines changed

3 files changed

+140
-146
lines changed
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
The short answer is: **no, they are not the equal**:
1+
Jawaban singkatnya adalah: **tidak, mereka tidak sama**:
22

3-
The difference is that if an error happens in `f1`, then it is handled by `.catch` here:
3+
Perbedaannya adalah bahwa jika terjadi sebuah _error_ di dalam `f1`, kemudian ditangani oleh `.catch` disini:
44

55
```js run
6-
promise
7-
.then(f1)
8-
.catch(f2);
6+
promise.then(f1).catch(f2);
97
```
108

11-
...But not here:
9+
...Tetapi bukan disini:
1210

1311
```js run
14-
promise
15-
.then(f1, f2);
12+
promise.then(f1, f2);
1613
```
1714

18-
That's because an error is passed down the chain, and in the second code piece there's no chain below `f1`.
15+
Itulah kenapa sebuah _error_ diturunkan ke _chain_, dan didalam bagian kode kedua disana tidak ada _chain_ dibawah `f1`.
1916

20-
In other words, `.then` passes results/errors to the next `.then/catch`. So in the first example, there's a `catch` below, and in the second one -- there isn't, so the error is unhandled.
17+
Dengan kata lain, `.then` meneruskan _result_/_error_ ke `.then/catch` selanjutnya. Jadi pada contoh pertama, ada sebuah `catch` di bawah, dan yang kedua -- disana tidak ada, jadi _error_ tidak ditangani.

1-js/11-async/03-promise-chaining/01-then-vs-catch/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Promise: then versus catch
22

3-
Are these code fragments equal? In other words, do they behave the same way in any circumstances, for any handler functions?
3+
Apakah potongan kode ini sama? Dengan kata lain, apakah mereka berperilaku sama dalam situasai apapun, untuk setiap _handler functions_?
44

55
```js
66
promise.then(f1).catch(f2);

0 commit comments

Comments
 (0)