Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
indexOf by condition instead of deep-equal
indexOf = function(collection, condition){
if(collection && Array.isArray(collection) && condition){
for(var i = 0; i < collection.length; i+=1){
return i;
return -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.