Practice ยท 1 of 3
Explorer Index
Write createExplorer(records) where each record has at least { id, score }. It RETURNS an object with:
- byId(id) โ the record with that id, or null (build a Map once, up front)
- count() โ the number of records
- top(n) โ the first n records sorted by score, highest first; ties keep their original order; if there are fewer than n, return them all
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Mini Build: Data Explorer