Skip to content

Commit 4cf1b49

Browse files
authored
finally pass
1 parent 8ce413e commit 4cf1b49

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

1-js/11-async/02-promise-basics/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ new Promise((resolve, reject) => {
234234
.then(result => نمایش نتیجه, err => نمایش خطا)
235235
```
236236
237-
That said, `finally(f)` isn't exactly an alias of `then(f,f)` though. There are few subtle differences:
237+
با این حال، `finally(f)` دقیقاً نام مستعار `then(f,f)` نیست. چند تفاوت ظریف وجود دارد:
238238
239-
1. A `finally` handler has no arguments. In `finally` we don't know whether the promise is successful or not. That's all right, as our task is usually to perform "general" finalizing procedures.
240-
2. A `finally` handler passes through results and errors to the next handler.
239+
۱. یک کنترل‌کننده `finally` هیچ آرگومانی ندارد. در `finally` ما نمی‌دانیم که آیا وعده(promise) موفق است یا نه. همه چیز درست است، زیرا وظیفه ما معمولاً انجام مراحل نهایی‌سازی "عمومی" است.
240+
۲. یک کنترل‌کننده `finally` نتایج و خطاها را به کنترل‌کننده بعدی منتقل می‌کند.
241241
242-
For instance, here the result is passed through `finally` to `then`:
242+
:منتقل می‌شود `then` به `finally` به عنوان مثال، در اینجا نتیجه از
243243
```js run
244244
new Promise((resolve, reject) => {
245245
setTimeout(() => resolve("result"), 2000)

0 commit comments

Comments
 (0)