Skip to content

Instantly share code, notes, and snippets.

@lanqy
Created August 13, 2013 01:51
Show Gist options
  • Save lanqy/6217130 to your computer and use it in GitHub Desktop.
Save lanqy/6217130 to your computer and use it in GitHub Desktop.
// from http://qiita.com/Oakbow/items/3374175d76d82792134d
(function () {
if (!("indexOf" in Array.prototype)) {
Array.prototype.indexOf = function (find, i) {
var n;
if (i === undefined) i = 0;
if (i < 0) i += this.length;
if (i < 0) i = 0;
n = this.length;
while (i < n) {
if (i in this && this[i] === find) return i;
i++;
}
return -1;
};
}
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment