Premium Only Content

`_.property` function on object using JavaScript Library underscore.js ( #shorts )
Hi Friends,
`_.property` function on object using JavaScript Library underscore.js
`_.property` function in Underscore.js library creates a function that returns the value of a specified property on an object. It is a easy way to get a specific property value from an object.
In below example, we create a function getName using _.property('name'). This function is now bound to the 'name' property. We then have an object person with properties like 'name' and 'age'. When we call getName(person), it retrieves the value of the 'name' property from the person object, which is "Annie".
Note: _.property function returns a new function that, when called with an object as its argument, retrieves the value of the specified property on that object.
// syntax
_.property(key)
// example
var getName = _.property('name');
var person = { name: 'Annie', age: 25 };
console.log(getName(person));
// "Annie"
#javascript #under #score #underscore #underscorejs #property #hastag #underscoreproperty #propertyfunction #unique #object #array #string #nodejs #javascriptinterview #method #js #jquery #function #shorts #viral #popular #latest #new #coders #development #code #dev #interview #php #trend #trending #answer #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
-
0:10
Pawanvir Singh Cheema
1 year ago`_.get` function on object using JavaScript Library underscore.js ( #shorts )
1 -
0:10
Pawanvir Singh Cheema
1 year ago`_.clone` function on object or array using JavaScript Library underscore.js ( #shorts )
11 -
0:10
Pawanvir Singh Cheema
1 year ago`_.range` function on array using JavaScript Library underscore.js ( #shorts )
10 -
0:10
Pawanvir Singh Cheema
1 year ago`_.unzip` function on array using JavaScript Library underscore.js ( #shorts )
6 -
29:25
Forrest Galante
7 hours agoPrivate Tour of Billionaire's Secret Animal Sanctuary in India
38.6K3 -
2:37:29
vivafrei
19 hours agoEp. 260: SCOTUS Blocks Trump Deportation? Letitia James Criminal Referral! RFK Jr. & Autism & MORE!
139K177 -
7:30:34
iCheapshot
11 hours ago $2.66 earnedSunday Funday! |Happy Easter! | Happy 420 #BlazeIt
27.6K1 -
2:25:04
TheSaltyCracker
9 hours agoHappy Easter ReeEEEe Stream 04-20-25
158K432 -
2:25:28
Tundra Tactical
9 hours ago $5.40 earned$3200 ZEV HEARTBREAKER Contest!!!
48.5K2 -
9:09:39
Delnorin Games
12 hours ago🔴 Live - Call of Duty
24.7K