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 Numbers The Math Object Use Math Methods

Can some body help me to solve this problem please I just stuck on the problem.

const temperature = 37.5;

alert(Math.round(temperature));

script.js
const temperature = 37.5;

alert(Math.round(temperature));

5 Answers

Hey 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)

>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 );

Thank you M/S Julia for solving my problem. Code works.

Glad to help. You can mark a question solved by choosing a "best answer".

This is the best response that resolve my problem. I very much appreciate for this help. Thank again.

Miss Julia Lam gives the best response to solve my problem. Thanks.