lib/vendor/sugar.js
function(all) {
      var result = [];
      arrayEach(this, function(el, i) {
        if(isArray(el)) {
          result.push(el.compact());
        } else if(all && el) {
          result.push(el);
        } else if(!all && el != null && el.valueOf() === el.valueOf()) {
          result.push(el);
        }
      });
      return result;
    }
function(all) {
      var result = [];
      arrayEach(this, function(el, i) {
        if(isArray(el)) {
          result.push(el.compact());
        } else if(all && el) {
          result.push(el);
        } else if(!all && el != null && el.valueOf() === el.valueOf()) {
          result.push(el);
        }
      });
      return result;
    }
*
@method compact([all] = false)
@returns Array
@short Removes all instances of %undefined%, %null%, and %NaN% from the array.
@extra If [all] is %true%, all "falsy" elements will be removed. This includes empty strings, 0, and false.
@example

[1,null,2,undefined,3].compact() -> [1,2,3]
[1,'',2,false,3].compact()       -> [1,'',2,false,3]
[1,'',2,false,3].compact(true)   -> [1,2,3]

*