Backbone’s model.save() method has the following signature:
model.save([attributes], [options])
I want to call it, but I don’t want to pass in any attributes, only options. I need it this way because I set the attributes before saving using model.set(attributes).
How can I pass in just one object to model.save() but indicate that it is the options object and not the attributes object?
The documentation is explicit on this so we have to look at the source:
And below that you’ll see various
if (attrs ...)checks. So if you sayyou’ll save the model as-is and you’ll be able to set your
options. Furthermore, if you say this:then that is (more or less) the same as: