Javascript Array get(index)

Description

Javascript Array get(index)


Array.prototype.get = function(index) {
  return this[index];
};

Array.prototype.set = function(index, value) {
  this[index] = value;/*from w  w  w . j a v  a2 s  . c om*/
};

Javascript Array get(index)

Array.prototype.get = function (index) {
    if (index >= 0)
        return this[index];
    else//from   w  w  w.jav  a 2s. c o  m
        return this[this.length + index];
};



PreviousNext

Related