Javatpoint Logo
Javatpoint Logo

Backbone.js model.toJSON()

The Backbone.js toJSON model returns copy of the attributes as an object for JSON stringification.

Syntax:

Parameter explanation:

options: : It defines parameters such as variable name and id used for a model when returning shallow copy of model's attributes.

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS tojson Model
Next TopicBackbone.js Sync





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