Travis build: 727 [ci skip]
This commit is contained in:
@ -6,14 +6,13 @@ Use `JSON.parse()` and a `try... catch` block to check if the provided argument
|
||||
|
||||
```js
|
||||
const isValidJSON = obj => {
|
||||
try{
|
||||
try {
|
||||
JSON.parse(obj);
|
||||
return true;
|
||||
}
|
||||
catch(e){
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user