Whenever you reload, this function gives a random number between 0 to 1 in decimal.
If you want to random number between 1 to 10 in decimal, we need to put “* 10” inside the random() function. But we can’t get 10.
document.write(Math.random() * 10);
If you want to have a random number in an integer between 0 to 10, we need to use “Math.trunc(Math.random()*10)”.