Answers for "check if can parse json javascript"

PHP
1

if json then parse

function isJson(str) {
    try {
        let value = JSON.parse(str);
      	return value
    } catch (e) {
        return str;
    }
}
Posted by: Guest on November-03-2020

Code answers related to "check if can parse json javascript"

Browse Popular Code Answers by Language