Skip to content

Instantly share code, notes, and snippets.

@xexi
Created September 1, 2017 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xexi/b852b8987d51d45d8b4be21a49f031ab to your computer and use it in GitHub Desktop.
Save xexi/b852b8987d51d45d8b4be21a49f031ab to your computer and use it in GitHub Desktop.
js arr random
"use strict";
function makeBall(cb){
var arr = [];
for(var i=1; i<=100; i++){
// if(!_.includes([1, 2, 3], i)) If any number is to be excluded ( _ by lodash )
arr.push(i);
}
cb(arr)
}
makeBall((m)=>{
console.log(m[Math.floor(Math.random() * m.length)]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment