Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if string is json parsable

var isJsonParsable = string => {
    try {
        JSON.parse(string);
    } catch (e) {
        return false;
    }
    return true;
}
 
PREVIOUS NEXT
Tagged: #javascript #check #string #json #parsable
ADD COMMENT
Topic
Name
4+8 =