Skip to content

Instantly share code, notes, and snippets.

@boldfacedesign
Created April 8, 2014 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boldfacedesign/10110879 to your computer and use it in GitHub Desktop.
Save boldfacedesign/10110879 to your computer and use it in GitHub Desktop.
fix Array.indexOf()
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment