Returns whether the given string is a JSON string
Optional
the string to check
whether the given object is a JSON string
isJsonString(`{"foo": "bar"}`); // trueisJsonString(`[{"foo": "bar"}]`); // trueisJsonString(`[{"foo": "bar"}, {"hello": "world"}]`); // true Copy
isJsonString(`{"foo": "bar"}`); // trueisJsonString(`[{"foo": "bar"}]`); // trueisJsonString(`[{"foo": "bar"}, {"hello": "world"}]`); // true
Returns whether the given string is a JSON string