55
rated 0 times
[
61]
[
6]
/ answers: 1 / hits: 18026
/ 13 Years ago, wed, september 28, 2011, 12:00:00
I want to create an array of specific attribute values from a Backbone collection.
var days = _.select(
this.collection.models,
function(model) {
return model.attributes.type === 'session';
}
);
days = _.pluck(days, 'attributes'),
days = _.pluck(days, 'date');
This works, but seems inefficient. Is there a way to accomplish the same thing without having to define days
three times?
More From » backbone.js