VOOZH about

URL: https://www.geeksforgeeks.org/javascript/backbone-js-clone-collection/

⇱ Backbone.js clone Collection - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Backbone.js clone Collection

Last Updated : 26 Jul, 2022

The Backbone.js clone Collection is a function used to form a new instance of the collection with an identical list of models. This method returns a copy of the collection and initiates a new instance of the collection with its list of models. 

Syntax: 

collection.clone() ;

Parameters: This method doesn't take any argument. 

Example 1: In this example, we will illustrate the Backbone.js clone Collection. We will copy one collection and initiate a new instance. 

Output:

👁 Image
Backbone.js clone Collection

Example 2: In this example, we will clone one collection and see whether methods are copied or not. 

Output:

👁 Image
Backbone.js clone collection

Reference: https://backbonejs.org/#Collection-clone

Comment