Help with finding subtotal, sales tax, tip, and delivery fee on a shopping cart

I’m having trouble coding subtotal, sales tax, tip, and delivery fee on a shopping cart. The link to the relevant formatted code is pasted below.

the total amount for the shopping cart works fine. I can’t exactly figure out how to add the subtotal, sales tax, tip, and delivery fee. I tried to code for the subtotal, sales tax, and delivery fee (didn’t do tip so don’t have to answer since I didn’t try tip).

Link to Code is below: https://codepen.io/emilysarah1/pen/oNYEYmb

Otherwise I can paste code below, but probably easier to check out link, let me know if I should do that.

Hope this makes sense,

Thanks!

A few pieces of advice.

  1. Click on the Gear icon in the Javascript box. Select Format Javascript and then Analyze Javascript.
  2. Some of your comments are using the HTML format (<!–)
  3. Look at the tax variable in the recalculateCart function.
var tax      = 0.07375
var deliveryFee = 5.00;
var tip      = 0.20;

tax = subtotal * tax

What do you think is happening to the tax for the second item? Is it still a percent?