Created
July 1, 2014 19:49
-
-
Save ComFreek/3afba7f9c0acd5fcbaa5 to your computer and use it in GitHub Desktop.
Lo-Dash indexOf with deep equality check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function indexOfDeep(arr, needle) { | |
return _.findIndex(arr,function (entry) { | |
return _.isEqual(entry, needle); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment