|
|
@@ -0,0 +1,30 @@
|
|
|
+let myBook = {
|
|
|
+ title: '1984',
|
|
|
+ author: 'George Orwell',
|
|
|
+ pageCount: 326
|
|
|
+}
|
|
|
+
|
|
|
+console.log(`${myBook.title} by ${myBook.author}`)
|
|
|
+
|
|
|
+myBook.title = 'Animal Farm'
|
|
|
+
|
|
|
+console.log(`${myBook.title} by ${myBook.author}`)
|
|
|
+
|
|
|
+// Challenge area
|
|
|
+
|
|
|
+// name, age, location
|
|
|
+
|
|
|
+// name is age and lives in location
|
|
|
+// increase age by 1 and print message again
|
|
|
+
|
|
|
+let person = {
|
|
|
+ name: 'Michael',
|
|
|
+ age: 32,
|
|
|
+ location: 'Canada'
|
|
|
+}
|
|
|
+
|
|
|
+console.log(`${person.name} is ${person.age} and lives in ${person.location}.`)
|
|
|
+
|
|
|
+person.age ++
|
|
|
+
|
|
|
+console.log(`${person.name} is ${person.age} and lives in ${person.location}.`)
|