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

Can someone please help me with the third objective please? When I clicked on the get help button nothing happened.

I'll write out my code for the objectives. var salesTotal = 9.99 * 47; var profit = 9.99 * 47 - 5.45 * 47; var profitPerUnit = 9.99 * 47 - 5.45 * 47 / 47; I used the / for division, but the computer thinks that I'm not.

script.js
var wholesalePrice = 5.45;
var retailPrice = 9.99;
var quantity = 47;
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

5 Answers

Tim I added the parenthesis and a bummer message popped up. I was able to figure it out though. I typed var profitPerUnit = profit / quantity;

Thank you. I'm apprehensive when it comes to learning how to code because it's really hard for me. I want to do the Tech Degree certificate, but I don't know if I can. I answered the questions at the beginning of the page, and based on my responses Treehouse recommended I do the Full Stack Java Script Tech Degree.

Ayaz, you are well along the way. It's hard for everybody. No matter what you already know there is more. Keep trying and don't be shy about asking for help! I've looked at many training materials and Treehouse is very well designed because each video just covers a few new things and then the quizzes and challenges require you to demonstrate them. So make sure you feel solid at every step before moving on. Keep calm and carry on!

Use parenthesis when you want to divide after performing the inside subtraction. Like this: var profitPerUnit = (9.99 * 47 - 5.45 * 47) / 47.

Thank you Tim.

Ayaz, Good job. You are really taking advantage of the language by expressing the profit per unit in the variables that were already defined! That is definitely the point of this exercise. Understanding the order of operations is more of a background task.

Keep up the good work, Tim