Math.random()



Q: What does Math.random() do?


When you use this method it will give you a pseudo-random number between 0 (inclusive) and 1 (exculsive).


Q: How do I use it?


Syntax:


			

Math.random();
			
		


Example:


Script:


					

function randomexample() {
    document.getElementById("random").innerHTML = Math.random();
}
				
					


Go to page

Back to main page