File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
1-js/06-advanced-functions/11-currying-partials Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ The task is a little more complex variant of <info:task/question-use-bind>.
88
99The ` user ` object was modified. Now instead of two functions ` loginOk/loginFail ` , it has a single function ` user.login(true/false) ` .
1010
11- What to pass ` askPassword ` in the code below, so that it calls ` user.login(true) ` as ` ok ` and ` user.login(fail ) ` as ` fail ` ?
11+ What to pass ` askPassword ` in the code below, so that it calls ` user.login(true) ` as ` ok ` and ` user.login(false ) ` as ` fail ` ?
1212
1313``` js
1414function askPassword (ok , fail ) {
Original file line number Diff line number Diff line change 55
66# Currying and partials
77
8- Till now we were only talking about binding ` this ` . Now let 's make a step further.
8+ Until now we have only been talking about binding ` this ` . Let 's take it a step further.
99
1010We can bind not only ` this ` , but also arguments. That's rarely done, but sometimes can be handy.
1111
@@ -146,7 +146,7 @@ More advanced implementations of currying like [_.curry](https://lodash.com/docs
146146
147147``` js
148148function curry (f ) {
149- return function (..args ) {
149+ return function (... args ) {
150150 // if args.length == f.length (as many arguments as f has),
151151 // then pass the call to f
152152 // otherwise return a partial function that fixes args as first arguments
You can’t perform that action at this time.
0 commit comments