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 math object

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>JavaScript Foundations: The Math Object</title>
    <link rel="stylesheet" href="core.css">
    <script>
      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 =

I realize I need to complete the code after the equals, which I've tried, but I keep getting the same error that there is no variable circumference defined...

Apparently I did something wrong when trying to get that to show up as code instead of text. Any pointers there would be appreciated too!

You used single quotes instead back ticks ``` located on the key right of the 1 key on a standard US keyboard.

Thanks. Did you fix that or is the treehouse forum just that intuitive?

I fixed it for you.

2 Answers

So for this task you need to know 2 things:

  • the math formula for circumference which is: circumference = pi * diameter
  • the way you reference pi in JavaScript which is: Math.PI

i have the same problem do you have any tips to what I can do to answer this correctly?