Javascript Array indexOf(ob)

Description

Javascript Array indexOf(ob)


Array.prototype.indexOf = function(ob) {
    var n=this.length;
     for(var i=0;i<n;i++) {
      if(this[i]==ob)return i;
     }/*from w  w w  .j  a  v a 2 s  . c  o m*/
     return -1;
};



PreviousNext

Related