Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 1 of 11

The plan, in plain words

Show on a big screen

8 min

Text size

One program for a whole kite mela sounds huge. It is four small jobs. Each kite gets a word, steady or dancer. The word says how the kite flies. The check-in list is where each kite is written on arrival.

Four jobs wait in a row.
Step 1 of 5
  1. Four jobs wait in a row.
  2. Collect reads today's kites off the check-in list.
  3. Decide guesses each kite's word.
  4. Order lines them up, shortest tail first.
  5. Report prints the sheet and its tally.

The rule

Split a big task into small, named jobs. This project has four: collect, decide, order, report. Each job does one thing.

  • const kites = []; — collect keeps today's rows. The [] is an empty list.
  • kiteCount(rows) returns how many rows the list rows holds. rows.length is that count.

Seven rows are on the check-in list. So kiteCount should return 7. An empty list is a real list too. Its count is 0. Either way, KITE SHEET prints.

Write the missing line. Then the first job of the mela runs.

Loading lab…

The sheet prints even with the line missing. Run it once like that. Read what prints. Then write the line and run it again.

Try the lab to finish this lesson.