Get Programming with JavaScript - Listing 3.12

Listing 3.12 - A blog post

var post = { id : 1, title : "My Crazy Space Adventure", author : "Philae", created : "2015-06-21", body : "You will not believe where I just woke up!! Only on a comet..." };

Further Adventures

Listing 3.12 - A blog post - Task 1

var post = { id : 1, title : "My Crazy Space Adventure", author : "Philae", created : "2015-06-21", body : "You will not believe where I just woke up!! Only on a comet..." }; // log some of the properties console.log(post.title); console.log("posted by " + post.author + " on " + post.created); console.log(post.body);

Listing 3.12 - A blog post - Task 2

var post = { id : 1, title : "My Crazy Space Adventure", author : "Philae", created : "2015-06-21", body : "You will not believe where I just woke up!! Only on a comet..." }; var post2 = { id : 2, title : "I'm Going On An Adventure!", author : "BB", created : "2012-12-12", body : "I'm off with some dwarves and a wizard." };