Javascript Array max(s)

Description

Javascript Array max(s)


Array.prototype.max = function (s) {
  s = s || Selector;//from w  ww. ja v a2s . c o m
  var l = this.length;
  var max = s(this[0]);
  while (l-- > 0)
    if (s(this[l]) > max) max = s(this[l]);
  return max;
};



PreviousNext

Related