/ Published in: JavaScript

Implements Array.indexOf for browsers that don't support the method.
Expand |
Embed | Plain Text
if (typeof Array.indexOf != 'function') { Array.prototype.indexOf = function(f, s) { if (typeof s == 'undefined') s = 0; for (var i = s; i < this.length; i++) { if (f === this[i]) return i; } return -1; } }
You need to login to post a comment.