Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

toJSON() returns an object #581

Open
wants to merge 1 commit into from

1 participant

@tsai0606

because toJSON() returns an object therefore log out [object Object] instead of the actual JSON string.

@tsai0606 tsai0606 toJSON() returns an object
because toJSON() returns an object therefore log out [object Object] instead of the actual JSON string.
f09b6ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 21, 2014
  1. @tsai0606

    toJSON() returns an object

    tsai0606 authored
    because toJSON() returns an object therefore log out [object Object] instead of the actual JSON string.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 chapters/03-internals.md
View
4 chapters/03-internals.md
@@ -156,7 +156,7 @@ var Todo = Backbone.Model.extend({
var todo1 = new Todo();
var todo1Attributes = todo1.toJSON();
-// Following logs: {"title":"","completed":false}
+// Following logs: [object Object]
console.log(todo1Attributes);
var todo2 = new Todo({
@@ -164,7 +164,7 @@ var todo2 = new Todo({
completed: true
});
-// logs: {"title":"Try these examples and check results in console.","completed":true}
+// logs: [object Object]
console.log(todo2.toJSON());
```
Something went wrong with that request. Please try again.