Using JavaScript to draw six random numbers

I’ve got a new booklet on Amazon titled “Drawing Six ‘Lucky’ Numbers”.
This is the first of a series called “Small Projects to Learn JavaScript”.

The idea is to offer micro projects where the reader practices and develops awareness of practical JavaScript concepts.

small projects to learn javascript
On this first booklet the project goes under the following rules
• To fetch five random numbers ranging from 1 to 75
• To fetch a sixth random number ranging from 1 to 15.
• The first five numbers cannot be repeated.
• Zero is not allowed.
• Numbers should be displayed in numerical order from the lowest to the highest, except for the sixth number, which stands on its own at the extreme right.Easy enough, right?If it sounds like a lottery drawing, it is because the rules for drawing numbers are identical to a known national game.

Hey, perhaps you will get lucky with it since random numbers are random numbers!
Don’t forget about me if you ever make it!

The booklet covers fundamental concepts such as:

•    Searching numeric arrays.
•    Using For loops.
•    Isolating code with functions.
•    Usage of Math random, ceil, floor and round.
•    How to separate code by its functionality.
•    A practical application of indexOf
•    Practicing using a Console.
•    Displaying an Array as string

Give it a try, it’s only 99 cents in the US, less than a cup of joe!

If you’re interested follow this link or click on the image:


Author: tarau

technical writer, web technologies

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s