Files
30-seconds-of-code/snippets/isValidJSON.md
2017-12-31 18:23:01 +05:30

22 lines
200 B
Markdown

### isValidJSON
Checks if the provided argument is an valid JSON.
```js
const arr = (obj) => {
try{
JSON.parse(obj);
return true;
}
catch(e){
return false;
}
}
```
```js
```