Backbone.js collection.shift()

The Backbone.js collection shift method is used to remove and return the first model form the collection. It takes the same option as remove() method.

Syntax:


Parameter explanation:

options:It specifies the model type which will be removed from the collection.

Let's take an example.

See this example:

Test it Now

Output:

Save the above code in shift.html file and open this file in a new browser.

BackboneJS shift Collection



Latest Courses