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 Staff
Hope this helps!