Click to generate your lottery numbers
A front-end JavaScript exercise to generate random numbers for the U.S. based lottery games, Mega Millions and Powerball.
- the HTML portion was a good way for me to brush up on when to use
id=and when to useclass= - the CSS portion, while simple, was still a good exercise in setting up something that was simple and pleasing to look at and also functional
- Javascript was a bit of a challange. I struggled on whether to
- generate the numbers using the
Mathobject or select them from an array of numbers- if an array, should I just use the
Mathobject to select numbers from the array? - if an array, should I randomize the array and select the first set?
- should I randomize the array and then use the
Mathobject to select numbers from the array?
- if an array, should I just use the
- ultimately I decided to generate random numbers using the
Mathobject
- generate the numbers using the