Javascript Array sparseFirst()

Description

Javascript Array sparseFirst()


Array.prototype.sparseFirst = function() {
  var first = this;
  for(a in this) {
    if(!isNaN(a)) {
      first = a;//ww w.j av  a 2  s .  co  m
      break;
    }
  }
  return first;
}



PreviousNext

Related