📖
Functional JS
  • Functional Programming in JS
  • Types of Functions
    • Pure Functions
    • Higher-Order Function
    • Closure
    • Currying
    • Partial Application
Powered by GitBook
On this page

Was this helpful?

  1. Types of Functions

Higher-Order Function

A function that returns a function and or accepts a function as an input parameter.

A function that returns a function

const fn = () => 'returning function value.';

const higherOrderFunction = () => fn;

A function that accepts a function as an input parameter

const fn = () => 'returning function value.';

const higherOrderFunction = (fn) => {};

A function that accepts a function as an input parameter and also returns a function

const fn = () => 'returning function value.';

const higherOrderFunction = (fn) => () => 'another returned function value.';

PreviousPure FunctionsNextClosure

Last updated 4 years ago

Was this helpful?