Home » Backbone.js model.defaults()

Backbone.js model.defaults()

by Online Tutorials Library

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:

You may also like