Skip to main content

Practice ยท 3 of 3

Safe JSON Layer

Write parseOr(raw, fallback) โ€” parse raw as JSON, RETURN the value or fallback on any failure (never throws; handles non-string inputs). Write serialize(value, fallback) โ€” RETURN the JSON string of value, or fallback when the value cannot be serialized (circular references, BigInt).

Difficulty: intermediate

Back to lesson: Practice: Boundaries โ€” Practice