Both underscore and lodash refuse to implement deep plucking, despite many requests from users and gists or modules that implement the feature.
_([{o:{a:1}},{o:{a:43}},{o:{a:234}},{o:{a:23}}]).pluck("o.a")
Why is deep plucking a bad idea?
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.
Sign up to join this communityBoth underscore and lodash refuse to implement deep plucking, despite many requests from users and gists or modules that implement the feature.
_([{o:{a:1}},{o:{a:43}},{o:{a:234}},{o:{a:23}}]).pluck("o.a")
Why is deep plucking a bad idea?
_.pluck(..., ['a', 'o'])
, instead of a string in some questionable path format that needs parsing._.getPath
that will accept an array of property names and a JSONPath string: documentcloud.github.io/underscore-contrib/#getpath