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 trialfahad lashari
7,693 PointsThe Work space does not update the code. When I check the JavaScript console. It shows the old code! y u no update?!
The Work space does not update the code. When I check the JavaScript console. It shows the old code! By old code I mean the code which is already there from when I open the work space.
Even If I change everything and click run, It does not work! and when I check for errors using ctrl+shit+j. It shows that there is an error on line 15 which is long gone! and the console shows the old code. Why does the work space not run my newly typed code?!
Jesus Mendoza
23,289 PointsAre you saving the work space before clicking run?
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! The code isn't being run in the workspace. It's being run from the browser. If it's not updating it's likely because your browser is loading in old cached data. Try clearing your browser cache and see if that helps!
fahad lashari
7,693 PointsThat was it! thank you!! thank you! :-D
fahad lashari
7,693 PointsYes I am saving the work before running it. Problem still persists
fahad lashari
7,693 Pointsfahad lashari
7,693 Pointsvar correctGuess = false;
var RandomNum = Math.floor(Math.random()) * 6 + 1;
var guess = prompt('I am thinking of a number between 1 and 6. Can you guess which number?');
var RandomNumIsLarger = false;
if (parseInt(guess) === RandomNum){
correctGuess = true;
}
if ( correctGuess ) { alert('You got it right!'); }
else { alert('Incorrect'); }