Nodejs Array Push push(data)

Here you can find the source of push(data)

Method Source Code

Array.prototype.push = function(data) {
   this[this.length] = data;/* ww w  . jav  a 2 s  .  c o m*/
   return this.length;
};

Related

  1. push()
    if (!Array.prototype.push) {
    Array.prototype.push = function () {
        var i, iLen;
        for (i = 0, iLen = arguments.length; i < iLen; ++i) {
            this[this.length] = arguments[i];
    };
    
  2. push()
    var a = ['a', 'b', 'c'];
    var b = ['x', 'y', 'z'];
    var c = a.push(b, true);
    console.log("a : " + a); 
    console.log("c : " + c); 
    Array.prototype.push = function () {
        this.splice.apply(
            this,
            [this.length, 0].concat(Array.prototype.slice.apply(arguments))
    ...
    
  3. push()
    Array.prototype.push = function () {
      for (var i=0; i<arguments.length; i++)
        this[this.length] = arguments[i];
      return this.length;
    
  4. push()
    Array.prototype.push = function()
      for (var i = 0; i < arguments.length; i++)
        this[this.length] = arguments[i];
      return arguments[i - 1];
    };
    
  5. push(elem)
    Array.prototype.push = function(elem) {
      this[this.length] = elem;
      return ++this.length;
    };
    
  6. push(value)
    function Array() {
      this.length = 0
    Array.prototype.push = function(value) {
      this[this.length] = value
      this.length += 1
    Array.prototype.pop = function() {
      if (this.length > 0) {
    ...
    
  7. push16(aWord)
    Array.prototype.push16 = function (aWord) {
       this.push((aWord >> 8) & 0xFF,
                 (aWord     ) & 0xFF);
    };
    
  8. push16(num)
    Array.prototype.push16 = function (num) {
        this.push((num >> 8) & 0xFF,
                  (num     ) & 0xFF  );
    };