Created
March 23, 2015 05:43
-
-
Save dbani-dev/7a77f98b2d1c2ed11343 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 mapWith (fn) { | |
return function (array) { | |
return _.map(array, fn) | |
} | |
} | |
var squareAll = mapWith(function (n) { return n * n }); | |
squareAll([1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment