From 7f1d5de09e923c0c22e8ac4b206e5679cf1b7515 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Wed, 22 May 2019 02:37:20 +0300 Subject: [PATCH] minor --- .../10-bind/5-question-use-bind/solution.md | 4 ++-- .../06-advanced-functions/10-bind/5-question-use-bind/task.md | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md b/1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md index 0cb673b1..403107ca 100644 --- a/1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md +++ b/1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md @@ -38,6 +38,6 @@ An alternative solution could be: askPassword(() => user.loginOk(), () => user.loginFail()); ``` -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()`. - +Usually that also works and looks good. +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()`. diff --git a/1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md b/1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md index eb19e664..fe6a9b4e 100644 --- a/1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md +++ b/1-js/06-advanced-functions/10-bind/5-question-use-bind/task.md @@ -2,7 +2,7 @@ importance: 5 --- -# Ask losing this +# Fix a function that loses "this" The call to `askPassword()` in the code below should check the password and then call `user.loginOk/loginFail` depending on the answer. @@ -34,5 +34,3 @@ let user = { askPassword(user.loginOk, user.loginFail); */!* ``` - -