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

Trouble with end coding after guessLess

Hi there,

I am having trouble with my coding. At the end of this exercise, the message "Sorry. The number was " + randomNumber "." is not being displayed after a person is prompted to guessLess.

Please help me spot this error.

https://w.trhou.se/7hcfchqqf7

2 Answers

HI Kayanne,

I ran your program it didn't appear to have any problem, when I ran it. After my 2nd attempt in guessing the incorrect number. I get the dialog box "Sorry the number was #"

Heres the program http://codepen.io/Trejo/pen/eNbBqr

Hey there David,

Thanks for running my code. Can you try running it and selecting a 6 and seeing if at the end you will see the message: "Sorry. The number was ___." I can't figure out why that message is not being displayed when a high number is first randomly selected by a user. If the user first randomly selects a number which is higher than the randomly selected number, and the second number they input is also incorrect they don't receive the end message which tells them what the computer-generated number was.

Hopefully that clarifies the problem a bit more. I appreciate your time and feedback.

Cheers!