Backbone.JS Clone()

The Backbone.JS Clone() model is used for two main purposes.

  • To create a deep copy of a model.
  • To copy one model object to another object.

Syntax:

Model.Clone () 

Example:

  

  
Example  
  
  
  
  
  
  

Output:

{"msg1":"Hello World.","msg2":"Welcome."}

Explanation: In the above example, the output is a deep clone of the X model.

Please follow and like us:
Content Protection by DMCA.com