How to use 'lintjson' in JavaScript

Every line of 'lintjson' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
717function checkJSON(obj) {
718 if (!obj) {
719 return true;
720 }
721 try {
722 JSON.stringify(obj);
723 } catch (e) {
724 return false;
725 }
726 return true;
727}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets