Answer
A higher-order function either accepts one or more functions as arguments, returns a function, or both — array methods like map, filter, and reduce are common built-in examples.
function multiplyBy(factor) {
return (n) => n * factor; // returns a function
}
const double = multiplyBy(2);
double(5); // 10Real-world example Building a configurable validation function generator, like requireMinLength(5).