Skip to content

Instantly share code, notes, and snippets.

@alexeyraspopov

alexeyraspopov/main.js

Last active Aug 29, 2015
Embed
What would you like to do?
Как избавиться от лишних аргументов функции в итераторах
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