Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #214 from booltype/gh-pages
Browse files Browse the repository at this point in the history
Typo in Model.get() sample code
  • Loading branch information
addyosmani committed Nov 10, 2012
2 parents f3c30ab + 15d8254 commit 6247433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.md
Expand Up @@ -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.)
Expand Down

0 comments on commit 6247433

Please sign in to comment.