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

Bummer! No variable named "circumference" has been defined?

Working on challenge task 1 of 4 on "The Math Object". Every time I try-

var circumference=

i get the error:

"Bummer! No variable named "circumference" has been defined. Make sure to declare the variable like: var circumference =..."

I have even tried copying and pasting, but nothing is working.

Thanks!

4 Answers

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

Hey there,

In your email it said you were doing Math.PI (diameter) however PI is a property not a method on the Math object - look in this video http://teamtreehouse.com/library/javascript-foundations/numbers/the-math-object at 6:20.

Hope that helps :)

Thanks! i figured it out. I have no idea why it was taking me so long to get it. :P

James Lister
James Lister
6,569 Points

I can't seem to get past here. I've been trying various combinations of the following;

var diameter = 5.75,

      a = 17,
      b = 42,
      c = 1337,
      ageIfILiveToYear2100 = (new Date(2100, 0, 1) - new Date(1995, 5, 16, 7, 20)) / (1000 * 60 * 60 * 24 * 365.242);
  var circumference = Math.pi *diameter;

Where am I going wrong?

James Lister
James Lister
6,569 Points

Tried this to;

var circumference = 2 * Math.pi * (diameter/2);

I think I'm missing the point

James Lister
James Lister
6,569 Points

Never Mind, I got it Math.PI (pi must be in caps)