javascript check if string is json parsable

JavaScript
var isJsonParsable = string => {
    try {
        JSON.parse(string);
    } catch (e) {
        return false;
    }
    return true;
}
Source

Also in JavaScript: