Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Latest commit

 

History

History
23 lines (15 loc) · 555 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 555 Bytes

JSON.tryParse

Rejected by tc39 on Nov 2023.

Problem to solve

try { return JSON.parse(str) } catch { return undefined }

Prior art

URL.canParse

Spec

JSON.parse ( _text_ [ , _reviver_ ] )

1. Let _result_ be Completion(Call(%JSON.parse%, *null*, << _text_, _reviver_ >> )).
1. If _result_ is an abrupt completion, return *undefined*.
1. Return _result_.