Update isValidJSON.md
This commit is contained in:
@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user