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

Stuck on this task, think it might be a bug?

http://teamtreehouse.com/library/creating-numbers-part-2

Does anybody know how to pass this? My answer is -

var mevol = 0x16

which prints out as 16, great!

But I get this reply instead.

"Bummer! "mevol" does have the decimal value 16 but should be declared using an octal literal, i.e., a number starting with a zero followed by any number of digits using characters 0 to 7."

1 Answer

Sander de Wijs
PLUS
Sander de Wijs
Courses Plus Student 22,267 Points

The value 0x16 is a hexadecimal number instead of an Octal. So leave out the 'x' and you will get a different value.

When you use an octal literal the value for 16 should be declared as 020. The octal system counts from 01 to 07. The next range is 010 to 017 (value 8 to 15). The next range is 020 to 027 (values 16 to 23).

Hope this helps.

Thank you, it worked perfectly, I have no clue how I didn't think of doing that!