how to check if it a valid url for json.parse code example
Example: javascript check if string is json parsable
var isJsonParsable = string => {
try {
JSON.parse(string);
} catch (e) {
return false;
}
return true;
}
var isJsonParsable = string => {
try {
JSON.parse(string);
} catch (e) {
return false;
}
return true;
}