Created
January 6, 2018 02:13
-
-
Save WonderDev21/791857af43fd12016841478eaded92a4 to your computer and use it in GitHub Desktop.
Yuki's answer 4
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 createArrayOfFunctions(x, y) { | |
var arr = []; | |
for(var i = 0; i<y; i++) { | |
var n = (x) => x + i; | |
arr[i] = n(x); | |
} | |
return arr; | |
} | |
console.log(createArrayOfFunctions(11, 5)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment