Nodejs Array Pop pop()

Here you can find the source of pop()

Method Source Code

Array.prototype.pop = function() {
   var elem = this[this.length - 1];
   delete this[this.length--];/*from   w w  w  . ja v  a 2  s . com*/
   
   return elem;
};

Related

  1. pop()
    Array.prototype.pop = function () {
       return this.splice(this.length - 1, 1)[0];
    };
    
  2. pop()
    var a = ['a', 'b', 'c'];
    var c = a.pop(); 
    Array.prototype.pop = function () {
        return this.splice(this.length - 1, 1);
    };
    var d = ['a', 'b', 'c'];
    var e = d.pop();
    console.log('e : ' + e); 
    
  3. pop()
    Array.prototype.pop = function () {
      var last = this[this.length-1];
      this.length = this.length-1;
      return last;
    
  4. pop()
    Array.prototype.pop = function() {
      returnValue = this[this.length-1];
      this.length--;
      return returnValue;
    };