So I have a list of objects like
var options =
[{"car" : "red"},{"house": "green"},{"dog":"bark"}]
That I am trying to turn into an array of values from that, so it would look like this:
["red","green","bark"]
Here is my (non-working) attempt
newUrl = _.each(options, function(obj){
return _.values(obj);
});
console.log(newUrl);
So iterate through each object and fetch the value. The iteration works, the .values does not seem to be working how I though it would though.
eachdoes not return anything. perhaps you need.reduce