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 Operators


I had to trick the Challenge. The enviroment does not work properly

5 Answers

The example you gave isn't supposed to work. You've used number literals.

The instructions state that you can only use the 3 variables and the common numeric operators. You can't use any numbers.

Take a look at the comment in the script which explains it better.

What did you have to do to trick the challenge? I don't remember there being any problems.

What was it that you thought should have worked but didn't?

For example, if you write var ten = c * 2 + 2; it does not work. Only + and - operators did not show any problems. So in the las variable, i had to alter the value of variable C, and put c = 100; then write var onehundred...etc

Ok, i checked again and it worked well, thanks. But it seemed more like a math challenge that a code challenge...jajaja

Yes, I agree with you. It seemed to be more about math. So I think there was many possible answers here and some will get you to the target number quicker than others.

I think for 100 I had multiplied c * c * c to get me to 64 and figured out what else I needed to make 100.

James Barnett
James Barnett
39,199 Points

Math and coding share something in common a way of solving problems called algorithms. I think what this code challenge is testing on is algorithmic thinking using arithmetic.

I did not see the challenge that way, but you are right. After all we are here to learn.