diff --git a/snippets/isValidJSON.md b/snippets/isValidJSON.md index e81748be9..2a7c91971 100644 --- a/snippets/isValidJSON.md +++ b/snippets/isValidJSON.md @@ -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;