1// Genereates a number between 0 to 1;
2Math.random();
3
4// to gerate a randome rounded number between 1 to 10;
5var theRandomNumber = Math.floor(Math.random() * 10) + 1;
1var randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
2//max is the highest number you want it to generate
3//min is the lowest number you want it to generate
1//an equation that returns either 1 or -1
2var number = ((Math.floor(Math.random() * 2) - 2) * 2) + 3