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

Zhihao Wang
Zhihao Wang
9,687 Points

How does this not equal ten?

What am I doing wrong in this challenge task?

var ten = c * b + b;

1 Answer

Hi Zhihao,

That passes for me. Where did you put it in relation to the other code? Did you initially get it wrong and then corrected it? Try refreshing the challenge if that's the case.

Zhihao Wang
Zhihao Wang
9,687 Points

I put it right after var three with a correctly put comma.

I've redone the task a few times, still get error.

Maybe it's a temporary glitch with the code challenge then. I literally copied and pasted your code into the challenge after passing task 1 and your code passed.

What error message are you getting?

Did you end the var three statement with a comma or a semicolon?

This passes through task 2 for me:

var three = c - a;
var ten = c * b + b;

Of course, you may have something different for var three

Zhihao Wang
Zhihao Wang
9,687 Points
var three = b + a,
       ten = c * b + b;

I'll try again I guess.

** Update

It works now, must be a glitch **

The challenge doesn't seem to like doing it that way.

Check the code I previously posted.

Zhihao Wang
Zhihao Wang
9,687 Points

Yea, I just used your version, weird how the comma glitches out that way. Thanks though.

You're welcome.

Your code worked in the console for me but not the challenge.