JavaScript · Intermediate · Ticket 2Ticket #20 · from Lena Fischer, Finance & Ops
  1. Example
  2. Warm-up 1
  3. Warm-up 2
  4. Ticket
Brief
NEW TICKET#20 · Reports

Revenue by month

Lena Fischer · Finance & Ops
Opened today

“Our accountant wants revenue per month for the quarterly report: only paid invoices, counted in the month they were paid. Last time, March was simply missing from the report because nothing was paid that month, and she thought we'd lost data. Every month in the range has to be there, with 0 when nothing came in. Hannah already wrote nextMonth, which turns "2026-12" into "2027-01". Can you write revenueByMonth?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket16 min
BY THE END YOU CAN
  • Group values into an object by a key
  • Start every key at 0 before adding, so nothing goes missing
  • Walk a range of months with a helper
About 20 minutes
Four short steps. Nothing is timed, and you can leave any time.