![]() |
VOOZH | about |
The Backbone.js unshift Collection is used to add model at the beginning of a Collection. It takes model as the first parameter and options as the second parameter. In this article, we will discuss the Backbone.js unshift Collection.
Syntax:
collection. unshift( model, options );
Parameters:
Example 1: In this example, we will illustrate The Backbone.js unshift collection. In this example, we will add 2 models using unshift in the collection.
Output:
Example 2: In this example, we will again add two models at beginning of the collection.