Created
September 1, 2017 08:20
-
-
Save xexi/b852b8987d51d45d8b4be21a49f031ab to your computer and use it in GitHub Desktop.
js arr random
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
"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