1
JavaScriptAdvanced#performance#functions
A function that takes a function as an argument or returns a function. Array methods, debounce and middleware are all higher-order functions.
function withLog(fn) {
return (...args) => { console.log(args); return fn(...args); };
}
const add = withLog((a,b) => a + b);