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

Invoice numbers your accountant can read

Lena Fischer · Finance & Ops
Opened today

“Our accountant wants invoice numbers she can read at a glance: a short code for the client, a dash, then that client's invoice count with four digits. Acme Studio's 42nd invoice should be ACME-0042. The code is the first four letters of the client's name in capitals, and only the letters A to Z count, so spaces, digits and symbols are skipped. Can you write invoiceNumber?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket11 min
BY THE END YOU CAN
  • Loop over the characters of a string
  • Check whether a character is a letter
  • Pad a number with padStart
About 15 minutes
Four short steps. Nothing is timed, and you can leave any time.