Contact: aviboots(AT)netvision.net.il
31,051 questions
40,769 answers
573 users
let i = 0; while (i < 20) { let number = Math.floor(Math.random() * (8)); // 0 - 7 console.log(number); i++; } /* run: 1 6 0 6 4 4 3 4 6 7 7 2 5 3 5 3 5 7 4 7 */
for (let i = 0; i < 20; i++) console.log(Math.floor(Math.random() * 10)); // 0 - 9 /* run: 4 8 9 4 7 7 3 6 6 1 1 0 3 1 3 4 8 1 9 9 */
const n = Math.random(); console.log(n); /* run: 0.15304185934544656 */
const n = Math.random() * 10; console.log(n); /* run: 4.003934410536152 */