JavaScript has native JSON.parse and JSON.stringify support.
JavaScript has native JSON.parse and JSON.stringify support.
const data = JSON.parse(text);const text = JSON.stringify(data, null, 2);try {
JSON.parse(text);
} catch (error) {
console.error(error.message);
}