Skip to content

Instantly share code, notes, and snippets.

@andrIvash
Last active November 29, 2017 21:01
Show Gist options
  • Select an option

  • Save andrIvash/936e5ab2f4e10cc72da806bcef149c54 to your computer and use it in GitHub Desktop.

Select an option

Save andrIvash/936e5ab2f4e10cc72da806bcef149c54 to your computer and use it in GitHub Desktop.
js-samples
function func (...arg) {
return (init) => {
return arg.reduce((res, fn) => {
return fn(res)
}, init);
}
}
var summ = func((a) => a+1, (b)=> b+2,(c) => c+3)(2);
console.log(summ);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment