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

Heidi Laursen
Heidi Laursen
3,524 Points

Task 1 passed and now that I've added task 2's code it's not passing. How do I add code without error? [RESOLVED]

I'm pretty sure the code is correct. But it isn't working I'll test it in the console.

script.js
var temperature = 37.5;
var temperatureRound = Math.round(temperature);
alert(temperatureRound);
console.log(temerature);
var temperatureFloor = Math.roundFloor(temperature);
alert(temperatureFloor);
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
Heidi Laursen
Heidi Laursen
3,524 Points

Mat.roundFloor isn't a function. It's Math.floor(). oops

Sean Henderson
Sean Henderson
15,413 Points

Did fixing the Mat.roundFloor bit fix it for you Heidi?

rydavim
rydavim
18,814 Points

I've added a 'resolved' tag to your post. Please let me know if your change did not resolve your issue.