Permalink
Browse files

Fix copy-paste typo in Model.get() sample code

  • Loading branch information...
1 parent f3c30ab commit 15d82546716487e560a32d55a65906a563f031bc Stefan Wallner committed Nov 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 index.md
View
@@ -635,7 +635,7 @@ var todo2 = new Todo({
completed: true
});
console.log(todo2.get('title')); // Retrieved with models get() method.
-console.log(todo2.get('completed')); // false
+console.log(todo2.get('completed')); // true
```
If you need to read or clone all of a model's data attributes use its `toJSON` method. Despite the name it doesn't return a JSON string but a copy of the attributes as an object. ("toJSON" is part of the JSON.stringify specification. Passing an object with a toJSON method makes it stringify the return value of that method instead of the object itself.)

0 comments on commit 15d8254

Please sign in to comment.