Backbone.JS Initialize()

The Backbone.JS Initialize() model invokes the class’s constructor when model is created.

Syntax:

new Model(attributes, options)   

Parameters: attributes: This parameter is used to define properties of a model. options: This parameter is used to specify the options such as id, name etc to be used with attributes.

Example:

  
  
  
 Model Example  
  
  
  
  
  
  

Output:

Hello World!

Explanation: The Backbone.JS Initialize() model will invoke the class’s constructor when model is created.

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