JSON.isParseableAsJSON()

This would be inefficient. To know if a string is valid JSON it needs to be fully parsed. If it is valid then it is going to do most of that same work again in JSON.parse.

GitHub - Jack-Works/proposal-json-tryParse: JSON.canParse has been presented in plenary but did not move forward at the time.

There is also

1 Like