Premium Only Content
`_.pluck` function on array using JavaScript Library underscore.js ( #shorts )
Hi Friends,
`_.pluck` function on array using JavaScript Library underscore.js
`_.pluck` is a utility function in Underscore.js library that allows you to extract a specific property value from each object in an array of objects. It simplifies the process of retrieving a particular property from multiple objects.
In below example, we have an array of objects students, where each object represents a student with properties such as name and age. We use _.pluck to extract the name property from each object, and the resulting names array contains the names of the students.
Note: starting from Underscore.js version 1.8.0, the _.pluck function has been deprecated in favor of the _.map function with a property shorthand.
// syntax
_.pluck(list, propertyName)
// example
var students = [
{ name: "Alice", age: 20 },
{ name: "Bobby", age: 22 },
{ name: "Charlie", age: 21 }
];
var names = _.pluck(students, "name");
console.log(names);
// ["Alice", "Bobby", "Charlie"]
#javascript #under #score #underscore #underscorejs #underscorepluck #pluckfunction #pluck #object #array #string #nodejs #javascriptinterview #method #js #jquery #function #shorts #viral #popular #latest #new #coders #development #code #dev #interview #php #trend #trending #answer #best #free #laravel #youtube #instagram #socialmedia #education #edit #how #india #knowledge #quiz #reels #short #subscribe #share #update #video #web #webdeveloper #website #webdesign #ytshorts #youtuber #princecheema_official @princecheema_official
-
LIVE
The Quartering
2 hours agoTrump Impeachment, Democrat Insurrection, Massive Scandal At Politico & DC Crash Update!
5,710 watching -
LIVE
Dr Disrespect
3 hours ago🔴LIVE - DR DISRESPECT - KINGDOM COME: DELIVERANCE 2 - FIRST IMPRESSION
4,203 watching -
9:06
CryptoWrld
9 hours agoHow Nonprofits Use Blockchain Tech
692 -
Coach Tommy Tuberville
4 hours agoSenator Tuberville, Rep Emmer Hosts Press Conference on Protection of Women and Girls in Sports Act
15 -
16:38
SLS - Street League Skateboarding
14 days agoRayssa Leal's Most Clutch SLS Wins Ever! 🥶🏆
60.2K2 -
1:06:29
Russell Brand
3 hours agoGaza Takeover? Trump’s Bold Plan Sparks Global Outrage – SF532
92.5K190 -
1:57:32
The Charlie Kirk Show
2 hours agoGaza Thoughts + DOGE The Destroyer | Sen. Schmitt, Benz | 2.5.2025
96.1K13 -
1:21:08
Simply Bitcoin
3 hours ago $0.84 earnedNEW REPORT: Bitcoin ETF Insider Doubles Down on UNTHINKABLE 2030 prediction! | EP 1176
16.5K -
LIVE
The Dana Show with Dana Loesch
2 hours agoTRUMP PLANS TO TAKE OVER GAZA | The Dana Show LIVE On Rumble!
752 watching -
59:36
The Dan Bongino Show
5 hours agoTrump Shocks The World With Major Announcement (Ep. 2416) - 02/05/2025
725K1.26K