Here you can find the source of last()
Array.prototype.last = function() { if (this.isEmpty()) { return null; }// w w w. j a v a2 s .c o m return this[this.length - 1]; };
Array.prototype.last = function() { return this[this.length - 1]; };
Array.prototype.last = function(){ return this[this.length-1]; Array.prototype.first = function(){ return this[0]; Array.prototype.removeAtIndex = function(index){ this.splice(index,1);
Array.prototype.last = function () { if (this.length > 0) return this[this.length - 1]; else return undefined;
Array.prototype.last = function() { return this[this.length-1];
Array.prototype.last = function () return this[ (this.length-1) ]; };
Array.prototype.last = function() { if (this.length == 0) return null return this.slice(this.length - 1)[0]
Array.prototype.last = function (arr) { return this[this.length-1]
Array.prototype.last = function(fn, scope) { if (Object.prototype.toString.call(this) !== '[object Array]') { throw new TypeError("`this` must be Array, not " + typeof this); if (typeof fn === 'undefined') { return this[this.length - 1]; if (typeof fn !== 'function') { throw new TypeError("Optional argument[0] must be predicate function if defined"); ...
Array.prototype.last = function (func) { var length = this.length - 1, item = null; for (var i = length; i >= 0; i--) { if (func(this[i])) { item = this[i]; break; return item;