Question: I'm looking for a way to, from a backbone collection, retrieve some kind of array of one specific attribute. 

```
var SomeModel = Backbone.Model.extend({
    defaults: function() {
        return {
            attr1: "something",
            attr2: "something",
            attr3: "darkside"
        };
    }
});

var SomeCollection = Backbone.Collection.extend({
    model: SomeModel,
    url: '/data.json',
});

```

Now assume I have something like above and I only want a collection/array/similar with only the attribute 'attr3'. Is there any nice way to get this (not by manually iterating through the SomeCollection and building a new Collection)? My understanding from underscore function "filter" is that it returns the entire SomeModel based on a certain premise, i.e. this is not what I want. Ideas?

Thanks

Answer: 
If you only want one attribute, you can use [\_.pluck](http://underscorejs.org/#pluck)

```
SomeCollection.pluck('attr3');

```

For multiple attributes, you can combine [\_.map](http://underscorejs.org/#map) on collections and [\_.pick](http://underscorejs.org/#pick) on models

```
SomeCollection.map(function (model) {
    return model.pick('attr2', 'attr3');
});

```

And a demo <http://jsfiddle.net/nikoshr/qpyXc/1/>

Or, for a more concise version using [`_.invoke`](http://underscorejs.org/#invoke)

```
SomeCollection.invoke('pick', 'attr2', 'attr3');

```

<http://jsfiddle.net/nikoshr/qpyXc/3/>
I think there is some misunderstanding here. In the code you posted, you setup default attributes for newly created models. Any model created via:

```
var model = new SomeModel({});

```

or: 

```
var collection = new SomeCollection();
// Add to collection
collection.add({});
// Add to collection AND sync with server
collection.create({});

```

will have those attributes set to given values, given that you don't define them differently in the hash passed to above functions.

Instead, I think you're asking for this:

```
// Create some models
var model_a = new SomeModel({attr1: "Alpha"});
var model_b = new SomeModel({attr1: "Beta"});
var model_c = new SomeModel({attr1: "Gamma"});

// Push them in the collection
var collection = new SomeCollection([model_a, model_b, model_c]);

```

THEN you can get an array of strings containing values for requested models attribute with:

```
collection.pluck(attributeName);

```

Which is itself a function inherited from Underscore.js, on which Backbone relies. 

I specify this to make clear that \_.pluck(array, attributeName) is available also *outside* Backbone context and works on *arrays*, not *collections*. Internally, collection.pluck calls \_.pluck(collection.models, fieldName).