![]() |
VOOZH | about |
The Backbone.js pluck Collection is used to Pluck an attribute from each model in the collection. This method is equivalent to the map function and returns a single attribute value from each model. This method takes the attribute name as a parameter that has to get from the model.
Syntax:
collection.pluck( attr );
Parameter:
Example 1: In this example, we will illustrate the Backbone.js pluck Collection. Here we will pluck the title attribute of each Model.
Output:
Example 2: In this example, we will pluck all the attributes of the Model and see the value of the attributes.