Is it a method in backbone that will take a collection of models and made an array of model id’s or any other specified attribute in the model?
I’m able to list the model’s is’s in the console.log but unsure how to make an array from it
for (var i=0; i<collection.models.length; i++){
console.log(collections.models[i].id)
}
You can use the Underscore method
pluckfor this:http://jsfiddle.net/upqqL/
Description of
pluckfrom the UnderscoreJS docs: