Backbone.JS Pluck()

The Backbone.JS Pluck() collection method retrieves the attributes from a model in a collection.

Syntax:

Collection.Pluck ( attribute )   

Parameters:
attribute: This parameter is used to specify the attribute of a model in a collection.

Example:

  

  
Example  
  
  
  
  
  
  
  


 

Output:

Attributes returned on pluck: 
Joy,Happy,Smiley

Explanation:
In the above example, the Pluck() method returns the “name” attributes from the model instances of a collection.