Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Created June 14, 2017 21:18
Show Gist options
  • Save tennisonchan/8f763ded87f1294bdbe1b6ee8d918061 to your computer and use it in GitHub Desktop.
Save tennisonchan/8f763ded87f1294bdbe1b6ee8d918061 to your computer and use it in GitHub Desktop.
let randomArray = (len=10, max=100) => [...new Array(len)].map(() => Math.floor(Math.random() * max))
let randomArrayOld = function(len, max) {
return Array.apply(null, Array(len)).map(function() {
return Math.floor(Math.random() * max);
});
}
let normalArray = (len=10) => [...new Array(len)].map((a,i) => i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment