I seem to be using this test a lot
if( object && object !== \"null\" && object !== \"undefined\" ){ doSomething(); }
on
Maybe like this:
var myObj = {}; var isEmptyObj = !Object.keys(myObj).length; if(isEmptyObj) { // true } else {