What are Higher Order Function in JavaScript
Functions that operate on other functions, either by taking them as arguments or by returing them, are called higher order functions.
function expression(name) {
return function() {
console.log(name);
}
}
let smile = expression('smile');
let laugh = expression('laugh');
smile(); // prints 'smile'
laugh(); // prints 'laugh'
References
Categories :
JavaScript