You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exotic[bound function](https://tc39.github.io/ecma262/#sec-bound-function-exotic-objects)object returned by`f.bind(...)`remembers the context (and arguments if provided) only at creation time.
13
+
Objek eksotis[bound function](https://tc39.github.io/ecma262/#sec-bound-function-exotic-objects)yang dikembalikan oleh`f.bind(...)`mengingat konteksnya (dan argumen jika ada) hanya pada waktu pembuatan.
It's a bit less reliable though in more complex situations where `user`variable might change *after*`askPassword`is called, but *before* the visitor answers and calls `() => user.loginOk()`.
41
+
Contoh diatas biasanya bekerja dan terlihat lebih rapih.
42
+
43
+
Cara ini sedikit kurang bisa digunakan didalam situasi yang lebih kompleks dimana variabel `user`mungkin berubah *setelah*`askPassword`dipanggil, tapi *sebelum* pengguna menjawab dan memanggil `() => user.loginOk()`.
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
importance: 5
1
+
nilai penting: 5
2
2
3
3
---
4
4
5
-
# Fix a function that loses "this"
5
+
# Perbaiki sebuah fungsi yang telah kehilangan "this"
6
6
7
-
The call to `askPassword()`in the code below should check the password and then call `user.loginOk/loginFail`depending on the answer.
7
+
Pemanggilan kepada `askPassword()`didalam kode dibawah harus memeriksa passwordnya dan lalu memanggil `user.loginOk/loginFail`tergantung dari jawabannya.
8
8
9
-
But it leads to an error. Why?
9
+
Tapi pemanggilan itu mengembalikan sebuah error. kenapa?
10
10
11
-
Fix the highlighted line for everything to start working right (other lines are not to be changed).
11
+
Perbaiki baris yang di tandai agar kodenya dapat berjalan dengan benar (baris lainnya tidak perlu diubah).
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
importance: 5
1
+
nilai penting: 5
2
2
3
3
---
4
4
5
-
# Partial application for login
5
+
# Pengaplikasian parsial untuk login
6
6
7
-
The task is a little more complex variant of<info:task/question-use-bind>.
7
+
Tugas yang ini adalah varian yang sedikit lebih sulit daripada<info:task/question-use-bind>.
8
8
9
-
The`user` object was modified. Now instead of two functions`loginOk/loginFail`, it has a single function`user.login(true/false)`.
9
+
Objek`user`nya telah dimodifikasi. Sekarang daripada menggunakan dua fungsi`loginOk/loginFail`, sekarang hanya memiliki satu fungsi`user.login(true/false)`.
10
10
11
-
What should we pass `askPassword`in the code below, so that it calls `user.login(true)`as`ok`and`user.login(false)`as`fail`?
11
+
Apa yang harus kita kirimkan kedalam `askPassword`di kode dibawah, apakah harus memanggul `user.login(true)`sebagai`ok`dan`user.login(false)`sebagai`fail`?
12
12
13
13
```js
14
14
functionaskPassword(ok, fail) {
@@ -30,5 +30,5 @@ askPassword(?, ?); // ?
30
30
*/!*
31
31
```
32
32
33
-
Your changes should only modify the highlighted fragment.
0 commit comments