How to pick multiple properties from an array using only underscorejs ?
var arr = [{Analytics:16}, {Technology:12}, {Medical:20}, {Operations:40}]
Output i required in the below format. [12,40,20,16]
Thanks
How to pick multiple properties from an array using only underscorejs ?
var arr = [{Analytics:16}, {Technology:12}, {Medical:20}, {Operations:40}]
Output i required in the below format. [12,40,20,16]
Thanks
var arr = [{Analytics:16}, {Technology:12}, {Medical:20}, {Operations:40}];
var output = [];
_.each(arr, function (e){output.push(_.flatten(e)[0])});
output = [16, 12, 20, 40];
_.reject(_.pluck(arr, "Medical"), function(val){ return _.isUndefined(val) }) for getting medical