Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

JavaScript Tutorial: Random Numbers

Loading...

Sign in or sign up now!
1,464
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 5, 2009

During coding in JavaScript, you may need to add a random factor to the whole thing. This tutorial will show you how.

The first half of the video is explanation of the code, while the second half contains examples. Feel free to skip around if you only want to see one part or another.

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (3)

Sign In or Sign Up now to post a comment!
  • nice, very helpfull!

  • This code is not optimal, you could just use

    alert(arrayName[Math.floor(Mat­h.random() * array.length)]);

  • nice guide!

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more