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

Ashley Franklin
Ashley Franklin
17,633 Points

Javascript Numbers/Operators Challenge Task 3 of 4

I'm not entirely confident to know whether it's an error, or I'm just doing something wrong.

To create a variable (nineteen) that is equal to 19, with a = 1, b = 2, and c = 4, I've used: var nineteen = (c * 4) + b + a;

If I use the same operators and do the math incorrectly, it will give me the error that it doesn't add up, but as soon as it does, I just get the bummer message that I can only use the available variables and operators.

Adding them instead of multiplying works fine and lets me pass, but I'd rather know what I'm doing wrong :)

Any ideas?

2 Answers

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

Well, I'm not sure but here is one:

var nineteen = c * c + b + a

By the way, I really like your website. I'd like to make a website that markets myself that well.

Ashley Franklin
Ashley Franklin
17,633 Points

ahh, I missed it! You were right, I just overlooked the obvious haha thanks!