Javascript Array evens()

Description

Javascript Array evens()

Array.prototype.evens = function () {
  var a = [], o = this;
  for (var i = 0; i < o.length; i++) {
    if (i%2!=0) a.push(o[i]);
  }/*w  w w.  j  a v a  2s . c o m*/
  return a;
};



PreviousNext

Related