Array.prototype.size = function(){ return this.filter(function(a){return a !== undefined;}).length };