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 Numbers Working with Numbers Doing Math

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

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.