Nodejs Array Last last()

Here you can find the source of last()

Method Source Code

/*/*from ww w. j  a v  a  2s  .c o  m*/
 * Copyright 2012 IMOS
 *
 * The AODN/IMOS Portal is distributed under the terms of the GNU General Public License
 *
 */

Array.prototype.last = function() {
    if (this.length > 0) {
        return this[this.length - 1]
    }
};

Related

  1. last()
    Array.prototype.last = function() {
      if(this.length>0) {
        return this[this.length-1];
      } else {
        return null;
    
  2. last()
    Array.prototype.last = function() {
      return this[this.length-1];
    };
    Array.prototype.last = function() {
      return this[0];
    };
    
  3. last()
    Array.prototype.last = function() {
      return this[this.length - 1];
    };
    Array.prototype.flatten = function() {
      return this.reduce(function(a, b) {
        return a.concat(b);
      });
    };
    
  4. last()
    Array.prototype.last = function() {
          return this[this.length-1];
    
  5. last()
    Array.prototype.last = function(){
        if(this.length > 0)
            return this[this.length-1];
        return null;
    };
    
  6. last()
    Array.prototype.last = function () {
        return this[this.length - 1];
    };
    
  7. last()
    Array.prototype.last = function () {
        return this[this.length - 1];
    };
    var Smart = Smart || {};
    
  8. last()
    Array.prototype.last = function () {
      return this.pop();
    };
    
  9. last()
    Array.prototype.last = function() {
        if (this.length > 0) {
            return this[this.length - 1]
    };