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

Octals???????

I am stuck on the Javascript Numbers part 2 challenge question: "Create a variable named "mevol" and assign the value 16 to it using an octal number literal." I have never heard of octals before and not being a math wiz this doesn't make any sense to me. I've watched the video and read the transcript a dozen times and I really just don't get it. If someone could just give me the answer so I can move on I'd really appreciate it.

2 Answers

Markus Ylisiurunen
Markus Ylisiurunen
15,034 Points

Hi,

you can use a number converter to convert from 10-based scale to 8-based scale (octal). This is one example: Translatorcafe. With Javascript you have to add leading zero to the octal value. Like if the converter says 16 is 20 in octals, in Javascript it would be 020.

Here is the code you should use:

    var mevol = 020;

Thank you so much. I tried to find additional info/converter about octals on Google but all I found was technical stuff about programming which didn't help. I really appreciate the converter info.