A function that receives another function as an argument or that returns a new function or both is called a Higher-order function. Higher-order functions are only possible because of the First-class function.
.map, .reduce, .filter, .addEventListener
Abstraction: They allow you to focus on what to do (e.g., Filter this list) rather than how to do it (e.g., Create a for-loop, check a condition, push to a new array).
DRY (Don't Repeat Yourself): You can write the core logic once (like the repeat function above) and change the behavior by passing different callbacks.
Composition: You can chain them together to create complex data pipelines.
Analogy: Think of a Higher-Order Function like a Power Tool. The tool itself (the HOF) knows how to spin or vibrate, but it's the Attachment (the callback) you plug into it that determines if it’s a drill, a saw, or a sander.