What makes a function higher-order?
A higher-order function is one that takes a function as an argument, returns a function, or does both of those things. That is the whole definition, and it is worth stating precisely, because people sometimes use the term loosely for any function that is passed around.
Taking a function as an argument is the most common case, and the array methods are all built this way. The map method takes a function and applies it to every element. The filter method takes a function that decides whether an element is kept. The sort method takes a comparison function. The reduce method takes a function that accumulates a result. The setTimeout function takes a function and calls it later, and event listeners take a function and call it when the event happens.
Returning a function is the other case, and it is the more interesting one when you want to compose behaviour together. A function that returns a function lets you build a pipeline. You call it once with a behaviour, and you get back something that you can call later with a value. That is how decorators, middleware chains, and currying are built.
Doing both at the same time is also common. A function that takes a behaviour and returns a new function that takes a value is a decorator, and the next question shows one of those in full.
The practical value of recognising higher-order functions is that they are the backbone of functional style. Because behaviour is treated as data, you can pass it around, store it, combine it, and test it in isolation. The cost is that code with several layers of callbacks is harder to read, which is why teams usually keep higher-order functions shallow and give them good names.