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

Lisa Rioni
Lisa Rioni
12,372 Points

Math objective question

The question is: Create a variable named "circumference" and assign the correct value to it by using the "diameter" variable and Math.PI. See the comment in the script for more information.

My answer is: circumference = diameter * Math.Pi,

The feedback is: Bummer! Sorry! That's not correct. Remember, the circumference should be equal to the diameter times Pi.

Um, isn't that what I entered????

3 Answers

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

It should be Math.PI, not Math.Pi. Also you might have done it on a different line but make sure you don't forget 'var' when declaring your circumference variable.

Lisa Rioni
Lisa Rioni
12,372 Points

That was it. I didn't capitalize both letters of PI. Thanks Ethan!

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

No worries, glad to help. Please remember to mark the answer as accepted too :)

Lisa Rioni
Lisa Rioni
12,372 Points

How do I mark the answer as accepted?

Ethan Lowry
Ethan Lowry
Courses Plus Student 7,323 Points

Looks like you figured it out - you just have to select a 'Best Answer' so that people can see the question has been answered. Thanks :)