Skip to content

Instantly share code, notes, and snippets.

@dewey92
Last active February 27, 2019 22:56
Show Gist options
  • Select an option

  • Save dewey92/17b9c8130680ca3825ac65a9269449ed to your computer and use it in GitHub Desktop.

Select an option

Save dewey92/17b9c8130680ca3825ac65a9269449ed to your computer and use it in GitHub Desktop.
Factory Fn - JS
const add = x => y => x + y
const identity = add(0)
const increment = add(1)
const decrement = add(-1)
identity(7) // 7
increment(7) // 8
decrement(7) // 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment