Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model.toJSON and collection.toJSON unused options argument #1222

Closed
drinchev opened this issue Apr 14, 2012 · 2 comments
Closed

model.toJSON and collection.toJSON unused options argument #1222

drinchev opened this issue Apr 14, 2012 · 2 comments

Comments

@drinchev
Copy link

This is not an issue at all, but while I was reading backbone.js I found out that there is unused options argument for those two methods :

// in Backbone.model

    toJSON: function(options) {
      return _.clone(this.attributes);
    },

// in Backbone.collection

    toJSON: function(options) {
      return this.map(function(model){ return model.toJSON(options); });
    },

is this intentional ?

@vincentbriglia
Copy link

It's handy if you want to write your own toJSON method. see #1098

@drinchev
Copy link
Author

I thought the purpose might be this... Although I checked the issues page for "toJSON", I probably missed #1098's commits. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants