JavaScript JavaScript Numbers Working with Numbers Doing Math

JAAFAR CHRAIBI
JAAFAR CHRAIBI
1,775 Points

Create another variable named profit. It should hold the value of salesTotal variable - wholesalePrice * quantity

if you sold 47 items for 9.99 but only paid 5.45 for each item, how much money did you make ?

script.js
const wholesalePrice = 5.45;
const retailPrice = 9.99;
const quantity = 47;
const salesTotal = retailPrice * quantity;
const profil = salesTotal - wholesalePrice * quantity;

1 Answer

Brandon White
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Treehouse Moderator

Hi JAAFAR,

Not completely positive what your question is, but if you’re not passing the challenge and you’re unsure as to why, then I would point out a typo in your code.

These are really easy to make, so no worries, but the challenge asks you to create a variable named profit, and you’ve written profil. Change that l to and t and you should be good to go.

If that’s not the question you have, let me know.