Practice ยท 1 of 3
Safe JSON Parse
Write safeParse(json, fallback) that RETURNS the parsed value when json is valid JSON, and RETURNS fallback when it is not. It must never throw, whatever the input.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Error Handling โ Practice