Merge pull request #1187 from Benjen/master

Issue #1145: Changed documentation to elaborate when to use a function to define model defaults.
This commit is contained in:
Jeremy Ashkenas
2012-04-09 13:09:19 -07:00

View File

@@ -924,7 +924,9 @@ alert("Dessert will be " + (new Meal).get('dessert'));
<p class="warning">
Remember that in JavaScript, objects are passed by reference, so if you
include an object as a default value, it will be shared among all instances.
include an object as a default value, it will be shared among all instances.
Defaults containing objects passed by reference should be defined using a
function if you do not wish to share these objects between all instances.
</p>
<p id="Model-toJSON">