Add a method to an array object (Extending an object)

Array.prototype.in_array = function(p_val) {
       for(var i = 0, l = this.length; i < l; i++) {
               if(this[i] == p_val) {
                       return true;
               }
       }
       return false;
}

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.