Skip to content

Instantly share code, notes, and snippets.

@komkanit
Last active January 28, 2017 12:20
Show Gist options
  • Select an option

  • Save komkanit/9f5404daf5e9420e874b61b389c2f203 to your computer and use it in GitHub Desktop.

Select an option

Save komkanit/9f5404daf5e9420e874b61b389c2f203 to your computer and use it in GitHub Desktop.
const add = (x, y) => x + y
const minus = (x, y) => x - y
const logSomeThing = (func) => (...args) => {
console.log(func(...args))
}
const logAdd = logSomeThing(add)
const logMinus = logSomeThing(minus)
logAdd(20, 5) // 25
logMinus(10, 3) // 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment