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.
|
||||
|
||||
```js
|
||||
const arr = (obj) => {
|
||||
const isValidJSON = obj => {
|
||||
try{
|
||||
JSON.parse(obj);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user