Skip to content

Instantly share code, notes, and snippets.

@CodersArts
Created October 18, 2019 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodersArts/9663aa540c38da4ceb6c6caac2310eeb to your computer and use it in GitHub Desktop.
Save CodersArts/9663aa540c38da4ceb6c6caac2310eeb to your computer and use it in GitHub Desktop.
It returns random integers
#Codersarts
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Math</h2>
<p>Math.floor(Math.random() * 20) returns a random integer between 0 and 19 (both
included):</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
Math.floor(Math.random() * 20);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment