Skip to main content

Checkpoint: Data Explorer Core

intermediate20 min readLesson 63 of 143

Combine closures, higher-order functions, Map/Set, destructuring, and error handling into the core of a small data explorer.

Six lessons in, you now own the JavaScript layer real applications are written in: closures for private state, higher-order functions for data flow, Map and Set for indexed lookups, destructuring for clean extraction, and deliberate error handling.

No new theory here. The challenge below asks you to combine all five into the core of a small data explorer โ€” grouping, deduplication, summarizing, and safe access โ€” the same shape of code the module project builds on.

Requirements:

  1. groupBy(records, keyFn) โ€” returns a plain object mapping each key to the array of records with that key.
  2. uniqueBy(records, keyFn) โ€” returns the records deduplicated by key, keeping the first occurrence of each.
  3. summarize(records) โ€” returns { count, avgScore, top } where avgScore is the mean of the score fields and top is the record with the highest score. An empty list yields { count: 0, avgScore: 0, top: null }.
  4. safeGet(records, index) โ€” returns the record at index, or null for out-of-range or non-integer indexes. It must never throw.

Take your time โ€” the tests check each function separately, so you can build and verify them one at a time.

Now practice

Mini Build: Data ExplorerBuild the explorer layer on top of the checkpoint core: a Map-backed index, a filter-sort-paginate query pipeline, and CSV export.3 challenges ยท ยท ~25 min