How to match an empty dictionary in Javascript?
You could extend Object.prototype
with this isEmpty
method to check whether an object has no own properties:
Object.prototype.isEmpty = function() { for (var prop in this) if (this.hasOwnProperty(prop)) return false; return true;};