I have an array that looks like this:
var array = [{name:"AName1", value: 1},{name:"AName2", value: 2}, ...];
How do I get all the values from a specific property? Say, I want to get all the names from every object in the array, creating a new array with those names ["AName1, "AName2", ...]
I've tried to use _.pick from underscore.js:
var result = _.map(array, function (current) {
return _.pick(current, 'Name');
});
but it creates another array of objects with only the name property, which is not what i want to do
Any help is appreciated, thanks!