function isEmpty(obj) {
  if (Array.isArray(obj)) {
    return obj.length === 0;
  } else if (typeof obj === 'object') {
    for (var i in obj) {
      return false;
    }
    return true;
  } else {
    return !obj;
  }
}
function isEmpty(obj) {
  if (Array.isArray(obj)) {
    return obj.length === 0;
  } else if (typeof obj === 'object') {
    for (var i in obj) {
      return false;
    }
    return true;
  } else {
    return !obj;
  }
}
function isEmpty ( obj ) { if ( Array . isArray ( obj ) ) { return obj . length === 0 ; } else if ( typeof obj === 'object' ) { for ( var i in obj ) { return false ; } return true ; } else { return ! obj ; } }
Mimics empty from PHP.
Mimics empty from PHP .
returns true if obj is empty