Skip to content

Instantly share code, notes, and snippets.

@fordlee404
Created September 10, 2013 02:22
Show Gist options
  • Save fordlee404/6504258 to your computer and use it in GitHub Desktop.
Save fordlee404/6504258 to your computer and use it in GitHub Desktop.
判断数组中是否有某个值
Array.prototype.inArray = function (value) {
for (var i=0,l = this.length ; i <l ; i++) {
if (this === value) {
return true;
}
}
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment