BackboneJS - Model to JSON - Backbone.js

Description

It returns a copy of the attributes as an object for JSON stringification.

Syntax


Parameters

  • options − It defines parameters such as the variable name, id used for a model when returning shallow copy of model's attributes.

Example


Output

Let us carry out the following steps to see how the above code works −

  • Save the above code in the tojson.htm file.
  • Open this HTML file in a browser.

Output

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Backbone.js Topics