Answers for "javascript check if stirng is json"

3

javascript check if string is json parsable

var isJsonParsable = string => {
    try {
        JSON.parse(string);
    } catch (e) {
        return false;
    }
    return true;
}
Posted by: Guest on April-28-2020

Code answers related to "javascript check if stirng is json"

Code answers related to "Javascript"

Browse Popular Code Answers by Language