Here you can find the source of compacted()
Array.prototype.compacted = function () { var tmp = []; for (var i = 0; i < this.length; i++) { if (this[i] !== undefined && this[i] !== null && this[i] !== false) { tmp.push(this[i]);/*w ww . j a v a 2 s . c o m*/ } } return tmp; };
Array.prototype.compact = function() { return this.reduce(function(res, el) { if(el !== null) { res.push(el); }; return res; }, [])
Array.prototype.compact = function() { return this.filter(function (i) { return !!i; }); };
Array.prototype.compact = function() { var comp = []; for (var i = 0;i < this.length; i++) { if (this[i]) { comp.push(this[i]); return comp;
Array.prototype.compact = function(deleteValue) { for (var i = 0; i < this.length; i++) { if (this[i] == deleteValue) { this.splice(i, 1); i--; return this; }; ...
Array.prototype.compact = function(fn) { for (var i = 0; i < this.length; i++) if (this[i] == null) { this.splice(i, 1); return this;
Array.prototype.compacted = function () { var tmp = []; for (var i = 0; i < this.length; i++) { if (this[i] !== undefined && this[i] !== null && this[i] !== false) { tmp.push(this[i]); return tmp; }; ...