Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7f1d5de

Browse files
committedMay 21, 2019
minor
1 parent db32cd0 commit 7f1d5de

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ An alternative solution could be:
3838
askPassword(() => user.loginOk(), () => user.loginFail());
3939
```
4040

41-
Usually that also works, but may fail in more complex situations where `user` has a chance of being overwritten between the moments of asking and running `() => user.loginOk()`.
42-
41+
Usually that also works and looks good.
4342

43+
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()`.

‎1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ importance: 5
22

33
---
44

5-
# Ask losing this
5+
# Fix a function that loses "this"
66

77
The call to `askPassword()` in the code below should check the password and then call `user.loginOk/loginFail` depending on the answer.
88

@@ -34,5 +34,3 @@ let user = {
3434
askPassword(user.loginOk, user.loginFail);
3535
*/!*
3636
```
37-
38-

0 commit comments

Comments
 (0)
Please sign in to comment.