Skip to content

Instantly share code, notes, and snippets.

@avernet
Created October 26, 2011 16:47
Show Gist options
  • Save avernet/1316955 to your computer and use it in GitHub Desktop.
Save avernet/1316955 to your computer and use it in GitHub Desktop.
CoffeeScript `v in a` in JavaScript
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
__indexOf.call(a, v) >= 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment