Higher-Order Functions in JavaScript

JavaScript·2 min read·Jan 1, 2025

As opposed to a first-order function, a higher-order function is a function that takes other functions as argument:

function higherOrder(firstClass) {  // ...}

Or returns a function as its result:

function higherOrder() {  return function() {    // ...  }}

When supplied as an argument or returned as a value, these functions are called first-class functions.

Note: First-class functions that are typically executed in response to an event but not returned are usually called callback functions.

function higherOrder(callback) {  callback();}

Unlock the program 🚀

Pay once, own it forever.

€79

30-day money-back guarantee

  • 13 modules
  • 113 lessons with full-code examples
  • 29 projects with commented solutions
  • All future lesson and project updates
  • Lifetime access

By submitting this form, you agree to the Terms & Conditions and Privacy Policy.