Created
November 8, 2014 18:54
-
-
Save digitalicarus/5ca160151af389a0bc2f to your computer and use it in GitHub Desktop.
repeat and accumulate
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 repeatAcc(n,f) { | |
var accum = []; for (; n>0; n--) { accum.unshift(f(n)); } | |
return accum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment