Created
July 31, 2015 13:42
-
-
Save radjivF/06a35bd001d6a3ba4a19 to your computer and use it in GitHub Desktop.
This file contains 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 findDeep(obj, key) { | |
if (_.has(obj, key)) | |
return [obj]; | |
return _.flatten(_.map(obj, function(v) { | |
return typeof v == "object" ? findDeep(v, key) : []; | |
}), true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment