September 2018
Intermediate to advanced
302 pages
7h 17m
English
We have learned about higher-order components, and in this section, we will have a look at the more general concept, called higher-order functions.
Have a look at the example. It's pretty straightforward. You wouldn't even notice you created anything special:
const add5 = x => x + 5; // functionconst applyTwice = (f, x) => f(f(x)); // higher order function applyTwice(add5, 7); // 17
So what is a higher-order function?
A higher-order function is a function that does one of the following:
That's it; it's so simple.
Read now
Unlock full access