Skip to main content

Practice · 1 of 3

Unknown Payload Handler

CHALLENGE
Difficulty: intermediate+25 XP

Write handleUnknown(payload) that narrows honestly: arrays of strings → { kind: "tags", tags } (trimmed); finite numbers → { kind: "count", count }; objects with string id → { kind: "entity", id }; anything else → { kind: "reject" }. Never throw.

Back to lesson: Practice: Boundaries — Practice