Articles → JavaScript → Math.random() function in JavaScript

Math.random() function in JavaScript






Purpose





Example


<html>
	<head>
		<title>Math.Random demo</title>
		<script>
            alert(Math.random());
        </script>
	</head>
	<body></body>
</html>



Output


Picture showing the output of Math.Random function in JavaScript

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, May 11, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250