index.js
function compact(obj) {
  if ('object' != typeof obj) return obj;

  if (isArray(obj)) {
    var ret = [];

    for (var i in obj) {
      if (hasOwnProperty.call(obj, i)) {
        ret.push(obj[i]);
      }
    }

    return ret;
  }

  for (var key in obj) {
    obj[key] = compact(obj[key]);
  }

  return obj;
}
function compact(obj) {
  if ('object' != typeof obj) return obj;

  if (isArray(obj)) {
    var ret = [];

    for (var i in obj) {
      if (hasOwnProperty.call(obj, i)) {
        ret.push(obj[i]);
      }
    }

    return ret;
  }

  for (var key in obj) {
    obj[key] = compact(obj[key]);
  }

  return obj;
}
function compact ( obj ) { if ( 'object' != typeof obj ) return obj ; if ( isArray ( obj ) ) { var ret = [ ] ; for ( var i in obj ) { if ( hasOwnProperty . call ( obj , i ) ) { ret . push ( obj [ i ] ) ; } } return ret ; } for ( var key in obj ) { obj [ key ] = compact ( obj [ key ] ) ; } return obj ; }
Compact sparse arrays.
Compact sparse arrays .