Skip to content

Instantly share code, notes, and snippets.

@juniorknx
Created March 5, 2018 17:22
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 juniorknx/73f8db104508dff1bdfdce3f159af7f9 to your computer and use it in GitHub Desktop.
Save juniorknx/73f8db104508dff1bdfdce3f159af7f9 to your computer and use it in GitHub Desktop.
RANDOM CODE
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Math</h2>
<p>Math.floor(Math.random() * 10) returns a random integer between 0 and 9 (both included).</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
Math.floor(Math.random() * 10);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment