Generating random numbers is a common thing in programming. Here is some examples in JavaScript:

1 2 3 4 5 6 7 8 9 10 |
//Basic Random Math.random(); //From 0 to specific number Math.random() * 10; //Removing decimals Math.floor(Math.random() * 10); //Random between 5 and 10 Math.floor(Math.random() * 5) + 5; //Random between 5 and 10 (included 10) Math.floor(Math.random() * 5) + 6; |