Answers for "validate js object"

PHP
8

check if string is valid object

function IsJsonString(str) {
    try {
        JSON.parse(str);
    } catch (e) {
        return false;
    }
    return true;
}
Posted by: Guest on April-10-2020

Browse Popular Code Answers by Language