Nodejs Array Append Item append(item)

Here you can find the source of append(item)

Method Source Code

/*****************************************************************************
 * Adding other prototypes from https://gist.github.com/578843
 *//*from  ww  w .j  a v a2s.  c  om*/

// Because I am an idiot and keep on using 'append', instead of 'push'.
Array.prototype.append = function (item) {
    this.push(item);
    return this;
};

Related

  1. append(arr)
    Array.prototype.append = function (arr) {
        if (arr) {
            for (var i = 0; i < arr.length; i++) {
                this.push(arr[i]);
        return this;
    };
    
  2. append(array)
    Array.prototype.append = function(array)
      this.push.apply(this, array)
    
  3. append(e)
    Array.prototype.append = function(e) {
      this.push(e);
    
  4. append(from)
    Array.prototype.append=function(from) {
      this[this.length]=from;
      return this;
    
  5. append(item)
    Array.prototype.append = function(item) {
      for (let i = 0; i !== this.length; i++) {
        if (this[i] === null || this[i] === undefined) {
          this[i] = item;
          return i;
      return this.push(item) - 1;
    };
    ...
    
  6. append(obj,nodup)
    Array.prototype.append=function(obj,nodup){
      if (!(nodup && this.contains(obj))){
        this[this.length]=obj;
    
  7. appendUniqueObj(oneItem)
    Array.prototype.appendUniqueObj = function(oneItem)
      if (!this.contains(oneItem))
        this[this.length] = oneItem;
    
  8. append_all(from)
    Array.prototype.append_all=function(from) {
      for(var i=0;i<from.length;i++) {
        this.append(from[i]);
      return this;
    
  9. Append( arr )
    Array.prototype.Append = function( arr )
        for ( var i = 0; i < arr.length; i++ )
            this.push( arr[ i ] );
    };