Skip to content

Instantly share code, notes, and snippets.

@xat
Created November 7, 2014 19:42
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 xat/9452fcb14e5d8440563a to your computer and use it in GitHub Desktop.
Save xat/9452fcb14e5d8440563a to your computer and use it in GitHub Desktop.
contains.js
var contains = function(arr, cb) {
for (var i=0, len=arr.length; i<len; i++) {
if (cb(arr[i], i)) return true;
}
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment