Update isValidJSON.md

This commit is contained in:
Angelos Chalaris
2017-12-31 15:02:19 +02:00
committed by GitHub
parent 8214ee3bec
commit 9bdd11dfd1

View File

@ -5,7 +5,7 @@ Checks if the provided argument is a valid JSON.
Use `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON. Use `JSON.parse()` and a `try... catch` block to check if the provided argument is a valid JSON.
```js ```js
const arr = (obj) => { const isValidJSON = obj => {
try{ try{
JSON.parse(obj); JSON.parse(obj);
return true; return true;