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 trialNasim Qureshi
13,478 PointsCan some body help me to solve this problem please I just stuck on the problem.
const temperature = 37.5;
alert(Math.round(temperature));
const temperature = 37.5;
alert(Math.round(temperature));
5 Answers
Oliver Duran
Full Stack JavaScript Techdegree Graduate 22,828 PointsHey Nasim, your challange says "Declare a new variable named tempRounded. Assign it the temperature variable rounded to the nearest integer". It looks like you are only sending a message to the browser with the alert() function. try this: const tempRounded = Math.round(temperature)
Julia Lam (Daly)
5,230 Points>const temperature = 37.5;
>alert(Math.round(temperature));
you are almost there. Instead of using alert, you need to create new variable
tempRounded as shown below:
const temperature = 37.5;
const tempRounded = Math.round(temperature );
Nasim Qureshi
13,478 PointsThank you M/S Julia for solving my problem. Code works.
Julia Lam (Daly)
5,230 PointsGlad to help. You can mark a question solved by choosing a "best answer".
Nasim Qureshi
13,478 PointsThis is the best response that resolve my problem. I very much appreciate for this help. Thank again.
Nasim Qureshi
13,478 PointsMiss Julia Lam gives the best response to solve my problem. Thanks.