Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

underscore filter array of objects

var evens = _.filter([{key: 1}, {key:2}, {key:3}, {key:4}, {key:5}, {key:6}], function(num){ return num.key % 2 == 0; });
=> [2, 4, 6]
Source by underscorejs.org #
 
PREVIOUS NEXT
Tagged: #underscore #filter #array #objects
ADD COMMENT
Topic
Name
8+9 =