The workshop demo parsed JSON, counted visits by topic, and tracked unique email addresses. Now process a shipping desk's parcel scans. Multiple scans of one parcel count as multiple scans but only one unique tracking ID. Work in script.js; no network or page markup is needed.
For example, a library check-in feed '[{"shelf":"A","card":"C1"},{"shelf":"A","card":"C1"}]' would produce a Map with A → 2 visits and a Set containing one card. Your task instead uses zone and tracking fields from parcel scans.
A small visitor feed shows JSON parsing, counting by key, and tracking unique IDs:
const visits = JSON.parse('[{"room":"East","badge":"B1"},{"room":"East","badge":"B1"}]');
const byRoom = new Map();
const badges = new Set();
for (const visit of visits) {
byRoom.set(visit.room, (byRoom.get(visit.room) ?? 0) + 1);
badges.add(visit.badge);
}
console.log(byRoom.get("East"), badges.size); // 2 1
parseScans(jsonText) to parse JSON scan records into an array.countByZone(scans) to return a Map counting every scan by zone.uniqueIds(scans) to return a Set of tracking IDs.summarizeScans(jsonText) to use those helpers and return { byZone, uniqueTracking }.summarizeScans("[]") return an empty Map and Set.North: 2 | South: 2 | unique: 3 from summarizeScans(scanFeed) on its own Console line.You can now turn structured input into useful lookups and summaries. Take the section quiz, then work precisely with text.
Parse jsonText once; then iterate each scan in the resulting array.
Use (byZone.get(scan.zone) ?? 0) + 1 to increment counts.