JavaScriptIntermediate#functions

What is a higher-order function?

A function that takes a function as an argument or returns a function. Array methods, debounce and middleware are all higher-order functions.

Example
function withLog(fn) {
  return (...args) => { console.log(args); return fn(...args); };
}
const add = withLog((a,b) => a + b);

Related Questions

1
JavaScriptAdvanced#performance#functions

What is memoization?

Open
2
JavaScriptBeginner#browser#storage

What are localStorage, sessionStorage and cookies?

Open
3
JavaScriptIntermediate#browser#async

How does fetch differ from XMLHttpRequest?

Open