Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
146
rated 0 times [  147] [ 1]  / answers: 1 / hits: 16107  / 9 Years ago, fri, february 5, 2016, 12:00:00

What happened to pluck() in lodash version 4? What is a suitable replacement?



This syntax _.pluck(users, 'firstName'); is simple to me. Seems that _.map(users, function(user) { return user.firstName; } would do the trick but it's not nearly as neat.


More From » lodash

 Answers
43

Looks like _.map(users, 'firstName'); should cover it.


[#63438] Wednesday, February 3, 2016, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kenandwightb

Total Points: 241
Total Questions: 95
Total Answers: 111

Location: Jersey
Member since Fri, Oct 1, 2021
3 Years ago
;