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

Code Challenge: Numbers. Doesn't seem to work well.

Hey guys! I am learning JS right now, and I was wondering why 1.6e6 is working while 1.6E6 is not working in code challenge..Still, in my JS console <u>it is</u> working.

Thanks a lot

Matthieu,

You're right. I am looking into this issue right now. I will post an answer in a bit.

Chris

Thanks for your reply Chris. There's a lot of "tiny" bugs but in the overall, that chapter is really great.

Matthieu B

6 Answers

Matthieu Boisjoli,

I have temporarily disabled the defective code challenges while they are being rewritten to behave consistently. I expect to have them back up tomorrow. So sorry for the issues!

Matthieu Boisjoli,

The misbehaving code challenges have been rewritten and tested for appropriate behavior. Thanks for your patience!

Great news! Thanks for all of your efforts, Chris & teamtreehouse!

Create a variable named "mevol" and assign the value 16 to it using an octal number literal.

var mevol = 0x10;

JavaScript Foundations Creating Numbers: Part 2 Variable "GermanyGDP" has a value of 3400000000000 Variable "mevol" has a value of 16

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.

Tommy Morgan
Tommy Morgan
Treehouse Guest Teacher

Michael Norton -

You're absolutely right! This kind of a problem should've never made it live. We strive to produce quality content and in this case we failed to meet our standards. Further, our mission is to help educate people in technology, and providing tools with the capacity to vex and frustrate is a failure to properly reach for that mission.

What happened here is that the test cases that we used to validate the correctness of this challenge weren't broad enough, and as a result we were unaware that there were any invalid results until users reported the issue. By then the best we could do was respond as quickly as possible to address the problem and apologize for our mistake. I know it might be too little too late in this instance, but I do want to let you know that we're revisiting these challenges and will be actively working to make them not only more robust but also provide more helpful and nuanced feedback to users when their code isn't what we expect.

As for the challenge you shared with us - you have a proper value; 0x10 is in fact 16, but it's not 16 in octal, it's 16 in hexadecimal. The difference is that little x. Numbers of the format 0xnnn are hexadecimal (base-16), where numbers of the format 0nnn are octal (base-8). Hopefully that will help you get through that challenge from here :)

Tagging Jim Hoskins, Tommy Morgan & Nick Pettit as they might be interested in this feedback.

This problem still hasn't been fixed? Making me a little frustrated.

David Grant, these code challenges were fixed months ago and are working properly. Can you post your code? A fresh set of eyes always helps!