Skip to main content

Data Explorer Core Check

Challenge on lesson: Checkpoint: Data Explorer Core

Build the core of a data explorer: 1. groupBy(records, keyFn) RETURNS a plain object mapping each key (from keyFn(record)) to the array of matching records. 2. uniqueBy(records, keyFn) RETURNS the records deduplicated by key, keeping the first occurrence of each. 3. summarize(records) RETURNS { count, avgScore, top } — the record count, the mean of the score fields, and the whole record with the highest score. Empty input returns { count: 0, avgScore: 0, top: null }. 4. safeGet(records, index) RETURNS the record at index, or null when the index is out of range or not an integer. It must never throw.

Difficulty: intermediate

Back to lesson: Checkpoint: Data Explorer Core