add isArrayLike and isValidJSON

This commit is contained in:
Rohit Tanwar
2017-12-31 18:23:01 +05:30
parent ab05a54cff
commit 417c5e2d66
2 changed files with 42 additions and 0 deletions

21
snippets/isValidJSON.md Normal file
View File

@ -0,0 +1,21 @@
### 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
```