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) Making Decisions with Conditional Statements Improving the Random Number Guessing Game

Why isn't Treehouse recognizing the changes in my code?

Hi everybody!

So I made some adjustments to my code, which you can see here under script. js at this link: https://w.trhou.se/g9zygm4z0a

but Treehouse isn't recognizing them? Previously, the prompt was "The genie is thinking of a magic number" but I changed it to "I am thinking of a magic number " and made sure to save the changes. The reason this is important to me is because I also think that none of my other changes to my workspaces are actually being saved, since every time I preview them it still stays the same. :(

What's going on? Would really appreciate any help or insight into this problem!

2 Answers

Have you tried refreshing your page?

Have you checked the developer console in your browser to see if your code has any errors? I spotted a couple of syntax errors.

Below you have a space between 'parse' and 'Int':

}else if ( parse Int(guess) > randomNumber ) {

Below, in your 'else if', you open two braces, but only close one:

else if ( parseInt(guess) < randomNumber ) {
  var guessMore = prompt('Try again. The number is more than guessMore '); 
    if (parseInt(guessMore) === randomNumber ) {
      correctGuess = true; 
}

Perhaps these are the reasons your code is not running correctly when you refresh the page?

You could also use the developer tools in your browser to check whether or not 'scripts.js' has been updated correctly after you save your work space.

Kevin Quiniano
Kevin Quiniano
5,820 Points

Could you please re-check your codes. maybe it is a logical error. or you forgot to refresh the page.