January 2020
Intermediate to advanced
470 pages
11h 13m
English
If we don't want to modify the original function, we'll create a higher-order function, which we'll (inspiredly!) name once(). This function will receive a function as a parameter and will return a new function, which will work only a single time. (As we mentioned before, we'll be seeing more of higher-order functions in Chapter 6, Producing Functions – Higher-Order Functions; in particular, see the Doing things once, revisited section.)
Our once() function may seem imposing at first, but as you get accustomed to ...
Read now
Unlock full access