Skip to content

Instantly share code, notes, and snippets.

@alexeyraspopov
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexeyraspopov/8cb133cc81fadb97239c to your computer and use it in GitHub Desktop.
Save alexeyraspopov/8cb133cc81fadb97239c to your computer and use it in GitHub Desktop.
Как избавиться от лишних аргументов функции в итераторах
function compose(f, g){
return (...args) => f(g(...args));
}
function identity(value){
return value;
}
function process(...list){
// something to do
}
[1, 2, 3].map(compose(process, identity));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment