Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created November 13, 2012 22:03
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 Veejay/4068732 to your computer and use it in GitHub Desktop.
Save Veejay/4068732 to your computer and use it in GitHub Desktop.
detect
_.detect(collection, function(item) {
// conditions here
},
{
one: function(item) {
// function to execute when one item is found
},
none:function(){
// function to execute when no item is found
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment