JavaScript · Beginner · Ticket 1Ticket #1 · from Tomás Reyes, Support Lead
  1. Example
  2. Warm-up 1
  3. Warm-up 2
  4. Ticket
Brief
NEW TICKET#1 · Invoices

Invoice total ignores the quantity

Tomás Reyes · Support Lead
Opened today

“A designer emailed us this morning. She billed a client for 3 hours at $80 an hour, and the invoice said $80. The client paid exactly that, so she's $160 short and not happy with us. It looks like the total counts each line once, whatever its quantity. Can you fix invoiceTotal before tonight's invoices go out?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket6 min
BY THE END YOU CAN
  • Add up values in a loop
  • Read a property from each object in an array
  • Spot when a line of code adds the wrong thing
About 10 minutes
Four short steps. Nothing is timed, and you can leave any time.