ELI5: Explain Like I'm 5

Higher-order function

Higher-order functions are special kinds of functions that take other functions as arguments. That means that the higher-order functions can call other functions when it is running, and those functions can be used to change how the higher-order function behaves.

Think of a higher-order function like a chef in a kitchen who can make a meal using different ingredients. The chef is the higher-order function, and all the individual ingredients are the other functions that are being passed into the higher-order function. The chef can combine all the ingredients in different ways to make different kinds of meals. Similarly, the higher-order function can combine the other functions that are passed into it in different ways to do different kinds of things.