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 Creating Numbers: Part 2

How do you declare an octal literal in js?

What am I doing wrong? It says to use <code> tags but I can't use a / in a script tag.

<!DOCTYPE html>
<html lang="en">
  <head>
    <title> JavaScript Foundations: Creating Numbers</title>
    <link rel="stylesheet" href="core.css">
    <script>
      // exponential notation
      //    1E6 === 1000000
      // 1.23E6 === 1230000
      var GermanyGDP = 3.4E12;
      // octal number literals
      //  06 ===  6
      //  07 ===  7 
      // 010 ===  8
      // 011 ===  9
      // 012 === 10
      <code>var mevol = 20;</code>
    </script>

  </head>
  <body>
    <h1>JavaScript Foundations</h1>
    <h2>Creating Numbers: Part 2</h2>
    <script src="viewer.js"></script>
  </body>
</html>

2 Answers

Christopher Hall
Christopher Hall
9,052 Points

I think this is resulting from an error in the challenge error message. You should not have <code> tags within the <script> tags. You're close with your answer for the mevol variable, but remember that octal numbers must begin with a 0.

I think it was an error. I tried it without the code tags and with the zero in front and it worked. Thanks!