Is object empty? [duplicate]

For ECMAScript5 (not supported in all browsers yet though), you can use:

Object.keys(obj).length === 0

Leave a Comment