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

Create a variable named "circumference" and assign the correct value to it by using the "diameter" variable and Math.PI.

Hi,

I think i may have found a potential bug on the challenge.

I have declared the circumference variable with the following code:

var circumference = Math.PI() * diameter;

Yet I still get the following error:Bummer! No variable named "circumference" has been defined. Make sure to declare the variable like: var circumference =...

Any help would be much appreciated.

Cheers, Fraser

1 Answer

No, there is not bug. The problem is that you're trying to call a function called Math.PI() when in fact Math.PI is a constant. So you would just remove the parentheses and then I bet it'll work out.

Thanks, Eirik, that worked perfectly. Yeah no bug just me being an idiot aha!