Get Programming with JavaScript - Listing 3.07

Listing 3.07 - Objects with multiple properties

var book1; var book2; book1 = { title : "The Hobbit", author : "J. R. R. Tolkien" }; book2 = { title : "Northern Lights", author : "Philip Pullman" };

Further Adventures

Listing 3.07 - Objects with multiple properties - Task 1

var book1; var book2; book1 = { title : "The Hobbit", author : "J. R. R. Tolkien", published : 1937 // add a third property }; book2 = { title : "Northern Lights", author : "Philip Pullman", // don't forget the comma published : 1995 };

Listing 3.07 - Objects with multiple properties - Task 2

var book1; var book2; book1 = { title : "The Hobbit", author : "J. R. R. Tolkien", published : 1937 }; book2 = { title : "Northern Lights", author : "Philip Pullman" published : 1995 };

Listing 3.07 - Objects with multiple properties - Task 3

var book1; var book2; book1 = { title : "The Hobbit", author : "J. R. R. Tolkien", published : 1937 }; book2 = { title : "Northern Lights", author : "Philip Pullman" published : 1995 }; console.log(book1); // log to the console console.log(book2); //