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 trialBillie Barnett
UX Design Techdegree Graduate 17,463 PointsHelp with the second challenge!
I cannot find the mistake in my code. I can enter in the first two values, but the message will not display.
var input1 = prompt("Please enter a starting number"); var bottomNubmer = parseInt(input1); var input2 = prompt("Please enter a number."); var topNumber = parseInt(input2); var randomNumber = Math.floor(Math.random() * (topNumber - bottomNumber + 1)) + bottomNumber; var message = "<p>" + randomNumber + " is a number between " + bottomNumber + " and " + topNumber + ".</p>"; document.write(message);
2 Answers
Matthew Long
28,407 PointsYour variable is misspelled. You have it written as bottomNubmer
. You can check the console of your browser and it should tell you something like "bottomNumber
is not defined".
Damien K. Sedgwick
6,514 Pointsvar input1 = prompt("Please enter a starting number"); var *** bottomNubmer *** = parseInt(input1); var input2 ...
I've highlighted where the mistake is incase you couldn't find it.