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!
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
Used a different code, same output...
Checkout my code which does the exact same thing except it's way shorter and easier:
var no1=prompt("Type a Number *****"); var no2=Math.ceil(Math.random()*no1); alert("Random number until "+no1+" is "+no2);
He's rounding down and adding 1, I'm rounding up and not adding anything. Same pinch. Tested out 1 to 2 20 times and never gave me an incorrect output. So... What was the need for the +1...? And in the the video once the output between 1 and 6 is 6 which is incorrect?
Anyway, just wanted to point this lil bit of trivia out. Thanks.
Moderator edited: Profanity removed from code and markdown added so that the code properly renders in the forums.
Jennifer NordellTreehouse Teacher
Hope this helps!