Last active
August 29, 2015 14:00
-
-
Save alexeyraspopov/8cb133cc81fadb97239c to your computer and use it in GitHub Desktop.
Как избавиться от лишних аргументов функции в итераторах
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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