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 Basics (Retired) Working With Numbers Doing Math

Create another variable named profit. It should hold the value of the salesTotal variable minus the wholesalePrice multi

Keeps telling me to go back to task 1 because its not passing when I clearly have it correct. this is a flat-out bug.

var wholesalePrice = 5.45;
var retailPrice = 9.99;
var quantity = 47;
var salesTotal = retailPrice * quantity;
var profit = salesTotal - wholeSalePrice * quantity;
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="script.js"></script>

3 Answers

You have a capital S in wholeSalePrice when the S is supposed to be lowercase.

JavaScript is case-sensitive which means that even if you have a uppercase letter in a variable name and you type it lowercase (or the other way around), it would be considered a different variable.

I hope this helps. ~Alex

Looks like you have a capital S in "wholeSalePrice". Should be "wholesalePrice".

var profit = salesTotal - wholesalePrice * quantity;
Steven Parker
Steven Parker
229,018 Points

:point_right: The "not passing task 1" could just be a syntax error.

Since the challenge re-tests the older tasks first, if a syntax error has been introduced it may cause it not to pass task 1 even though the error is not in the code that was added for task 1.

But for your task 2 code, you spelled "wholeSalePrice" with a capital "S", when the variable already established by the challenge is "wholesalePrice" (lower-case "s").