Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

_.pluck

//The _.pluck() function is used when we need to extract 
// a list of a given property
import * as _ from 'underscore'

const list = [{name: 'jack', age: 14}, {name: 'jill', age: 15}, {name: 'humpty', age: 16}];
console.log(_.pluck(list, 'age'));

// Output: [14,15,16]


Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript test cases 
Javascript :: react portals 
Javascript :: shorthand arrow function 
Javascript :: react native setTimeOut error 
Javascript :: how to control where the text cursor on div 
Javascript :: time difference in javascript 
Javascript :: crud in node 
Javascript :: add element in array 
Javascript :: react native svg size 
Javascript :: bonjour 
Javascript :: save to local storage 
Javascript :: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 
Javascript :: enhanced object literals in es6 
Javascript :: javascript if equal infinity 
Javascript :: react functional component 
Javascript :: pure function 
Javascript :: keyframe options 
Javascript :: mergesort 
Javascript :: Import A Module In ExpressJS 
Javascript :: scss variables in react 
Javascript :: how to rerender a page in React when the user clicks the back button 
Javascript :: quote 
Javascript :: JavaScript - HTML DOM Methods 
Javascript :: Javascript async await & Promise 
Javascript :: node md5 decrypt 
Javascript :: dom 
Javascript :: js exports 
Javascript :: How do I use for-loops js 
Javascript :: resize js 
Javascript :: map duplicate keys JS 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =