pluckcollection.pluck(attribute)
Pluck an attribute from each model in the collection. Equivalent to calling map
and returning a single attribute from the iterator.
1 2 3 4 5 6 7 8 9 | var stooges = new Backbone.Collection([ {name: "Curly" }, {name: "Larry" }, {name: "Moe" } ]); var names = stooges.pluck( "name" ); alert(JSON.stringify(names)); |
Please login to continue.