Skip to content

Instantly share code, notes, and snippets.

@h09shais
Created June 19, 2019 15:34
Show Gist options
  • Save h09shais/234b3a2bfa04be49aeaa54f4d2bc4b6c to your computer and use it in GitHub Desktop.
Save h09shais/234b3a2bfa04be49aeaa54f4d2bc4b6c to your computer and use it in GitHub Desktop.
Higher order function
const add = (x, y) => x + y
add(1,3)
const createAdder = (a) => (b) => add(a, b) // Higher order function
const add2 = createAdder(3)
add2(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment