Skip to content

Instantly share code, notes, and snippets.

@WonderDev21
Created January 6, 2018 02:13
Show Gist options
  • Save WonderDev21/791857af43fd12016841478eaded92a4 to your computer and use it in GitHub Desktop.
Save WonderDev21/791857af43fd12016841478eaded92a4 to your computer and use it in GitHub Desktop.
Yuki's answer 4
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