Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

underscore js filter array of objects

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