Every line of 'math.floor(math.random() * 2)' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
46 function randomInt(max) { 47 return Math.ceil(Math.random() * max) 48 }
21 export function randomInt(min, max){ 22 return Math.ceil( min - 0.5 + (Math.random() * max)); 23 }
8 function randomInt () { 9 return Math.round(Math.random() * 255) 10 }
11 randomInt(n) { 12 return Math.round(Math.random() * n); 13 }
19 function _random(max) { 20 return Math.round(Math.random() * 1000) % max; 21 }
3 function _random(max) { 4 return Math.round(Math.random()*1000)%max 5 }
1 function _random(max) { 2 return Math.round(Math.random()*1000)%max; 3 }
5 static randomInt() { 6 return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); 7 }
112 function randomInt(max: number): number { 113 return Math.floor(Math.random() * max); 114 }
15 export function getRandomInt(min = 0, max = 100) { 16 min = Math.ceil(min); 17 max = Math.floor(max); 18 return Math.floor(Math.random() * (max - min + 1)) + min; 19 }