4 ms·
You're probably thinking of `JSON.stringify()`. `model.toJSON()` just returns a clone of the models attributes object.
by papercrane 14y ago
You're probably thinking of `JSON.stringify()`. `model.toJSON()` just returns a clone of the models attributes object.
- zimbatm 14y agoSo `model.toJSON()` isn't supposed to return a JSON-compatible data structure ?
- papercrane 14y agoIt's supposed to return an object that is suitable for turning into JSON, but it won't convert any of items members. JSON.stringify relies on the toJSON functions of the members to serialize themselves.