Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Working With Numbers The Random Challenge Solution

Jason Daniels
PLUS
Jason Daniels
Courses Plus Student 4,043 Points

Comment on Random Number Challenge

The challenge did not ask to have a user-entered starting number, nor did it ask that the result be written to the page, but the solution seemed to assume that this was expected.

I just wanted to make you aware.

3 Answers

Aman Mundra
Aman Mundra
2,755 Points

If you go to the previous video ("The Random Challenge", 43 seconds in length), from :36 seconds to :43 seconds, he specifically mentions starting the random number at the first value that the user inputted.

Jason Daniels
PLUS
Jason Daniels
Courses Plus Student 4,043 Points

Thanks, Aman... you are correct - I missed that instruction at the end!

I had reviewed the challenge prior to working on it, and only listened to the initial portion of the video, so I was only getting where he specifically states "Collect a number from a user and print a random number from 1 to the user's provided number." (:12 to :16)

For what it is worth, this is a good lesson in identifying project requirements and listening closely to the project owner. I give myself a "bummer" for missing this one!

Aman Mundra
Aman Mundra
2,755 Points

No problem! I've made the same mistake too before!