Created
December 5, 2015 06:56
-
-
Save chuck0523/507dd0644a06cc368c6a 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 splat(fun) { | |
return function(array) { | |
return fun.apply(null, array); | |
}; | |
} | |
var addArrayElements = splat(function(x, y) { return x + y }); | |
addArrayElements([1, 2]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment