mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user