Javascript Array last( set )

Description

Javascript Array last( set )

Array.prototype.last = function( set ) {
  if ( set !== null || set !== undefined ) {
    this[ this.length-1 ] = set;//from w w  w. j a va 2s  . c om
  }

  return this[ this.length-1 ];
}



PreviousNext

Related