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) Working With Numbers Using Math Methods

preview/editor for script.js has delay display causing "task 1 no longer passing" message after task 2 completes

var temperature=37.5; //task 1 of 2 var temperature rounded up alert(Math.round(temperature)); //task 2 of 2 var temperature rounded down alert(Math.floor(temperature));

2 Answers

Thanks, Jeremiah! problem resolved.

What happened was I skipped Editor on first task seeing that my code resulted in the correct answer so when I go to the next task, my script.js was not showing up in the workspaces and I had to select Preview to bring my script.js back and Editor to add in the next code. and then the comment that 'task 1 is no longer passing' tells me I missed it.
Lesson: go step by step, no shortcuts.

Hey, I think they want you to create a new alert rather than changing the existing one. :) This seems to pass.

var temperature = 37.5;
alert(Math.round(temperature));
alert(Math.floor(temperature));

after task 1 was completed and passed, I went on to next (task 2), the script.js disappears with only index.html, I click on preview, nothing shows; I click editor then the script shows up so I tried to add the alert for the rounding down... the answer is correct as it shows up 37 but message says oops, task 1 no longer passing.

hmm, I'm not sure exactly what you are experiencing. When I go to the challenge for task 1 i enter

var temperature = 37.5;
alert(Math.round(temperature));

then for task 2

var temperature = 37.5;
alert(Math.round(temperature));
alert(Math.floor(temperature));

and it passes every time. The only way i can reproduce your error is to remove alert(Math.round(temperature)); from my answer in task 2. You must have both the alert() calls in order to pass task 2.