Javatpoint Logo
Javatpoint Logo

Backbone.js model.defaults()

The Backbone.js defaults model is used to set a default value to a model. It ensures that if a user doesn't specify any data, the model would not fall with empty property.

Syntax:

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS Default Model




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA