Higher-Order Function
#
What is Higher-Order Function?Functions that operate on other functions, either by taking them as arguments or by returning them are called higher-order functions.
#
For examplesWe can have functions that create new functions.
We can have functions that change other functions.
We can even write functions that provide new types of control flow.
There is a built-in array method, forEach, that provides something like a for/of loop as a higher-order function.