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 trialJAAFAR CHRAIBI
1,839 PointsCreate 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 ?
const wholesalePrice = 5.45;
const retailPrice = 9.99;
const quantity = 47;
const salesTotal = retailPrice * quantity;
const profil = salesTotal - wholesalePrice * quantity;
1 Answer
Brandon White
Full Stack JavaScript Techdegree Graduate 35,771 PointsHi 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.