Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Underscore Mixin - isJSON : checking if a string is a valid JSON #underscore #js #cc
isJSON: function(str) {
try {
} catch (e) {
return false;
return true;

This comment has been minimized.

Copy link

@rodolfoag rodolfoag commented Jul 27, 2015

_.isJSON(20) should return true or false?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment