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

hakan Gülay
hakan Gülay
8,489 Points

ı couldnt solve this question.I couldnt find where ı make mistake

http://teamtreehouse.com/library/the-math-object

hi, in this question it wants circumference, and ı used var circumference=Math.PI()*diameter; or var circumference=Math.floor(Math.PI()*diameter); can you please tell me where ı make mistake ?

2 Answers

Erik McClintock
Erik McClintock
45,783 Points

Hakan,

Drop the parentheses after .PI and you'll be good to go. When I enter your code in, the error I receive says "There was an error with your code: TypeError: '3.141592653589793' is not a function (evaluating 'Math.PI()')".

You want simply:

var circumference = Math.PI * diameter;

Hope this helps!

Erik

hakan Gülay
hakan Gülay
8,489 Points

thanks a lot. ı couldnt think that :)