From d3459b41b2fcc41667ded87e6de6552f580565a7 Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 20:43:09 -1000 Subject: [PATCH 01/10] create variable called myName --- basics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/basics.js b/basics.js index 94aaf06..e1582d6 100644 --- a/basics.js +++ b/basics.js @@ -1,4 +1,5 @@ /* Create a `myName` variable and assign it a String value */ +var myName = ""; /* Create a `person` variable and give it 2 properties, * `name`, assign it the same name as before, From dca891c584a3c36d91189a556f9ae3d9296ecbaf Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 20:47:41 -1000 Subject: [PATCH 02/10] create person variable --- basics.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basics.js b/basics.js index e1582d6..915ec20 100644 --- a/basics.js +++ b/basics.js @@ -5,6 +5,10 @@ var myName = ""; * `name`, assign it the same name as before, * as well as an `age` (number); */ +var person = { + name: myName, + age: 28 +}; /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old From 047e473459c0c9d4464bb6bba3e5a446a1a70a34 Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 20:52:12 -1000 Subject: [PATCH 03/10] create canDrive variable --- basics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/basics.js b/basics.js index 915ec20..ec3cf86 100644 --- a/basics.js +++ b/basics.js @@ -13,6 +13,7 @@ var person = { /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old */ + var canDrive = true; /* Create a function called `greet`, * it should take a 1 parameter, `name` From 299a26bc99872fcb5bd58c6c86bb01f0f8610b85 Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 20:53:56 -1000 Subject: [PATCH 04/10] create gree function --- basics.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basics.js b/basics.js index ec3cf86..a9f0f3c 100644 --- a/basics.js +++ b/basics.js @@ -19,6 +19,9 @@ var person = { * it should take a 1 parameter, `name` * and it should print "Hello, my name is {name}" */ + function greet(name) { + console.log("Hello, my name is " + name); + } /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); From d9de9749d7e404862e21cfecd5c4365dd41b1698 Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 21:03:29 -1000 Subject: [PATCH 05/10] create dataTypes array --- basics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/basics.js b/basics.js index a9f0f3c..58aff77 100644 --- a/basics.js +++ b/basics.js @@ -26,6 +26,7 @@ var person = { /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ + var dataTypes = ["string", 3.14, true, null, undefined, ["this", "is", "an", "array"], {property: "propertyValue"}]; /* Create a `dog` object * it should have a `bark` function that makes your dog bark! From e6005e66e4c38e4f3b9bc99ba55ac973b0a52ea0 Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 21:04:48 -1000 Subject: [PATCH 06/10] create dog object --- basics.js | 1 + 1 file changed, 1 insertion(+) diff --git a/basics.js b/basics.js index 58aff77..7f1bbcf 100644 --- a/basics.js +++ b/basics.js @@ -32,3 +32,4 @@ var person = { * it should have a `bark` function that makes your dog bark! * It should also have a name attribute with the value of 'Spot' */ + var dog = {}; From 4020bb79f5a88648c2bf86006bc67d0f959fa38e Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 21:05:27 -1000 Subject: [PATCH 07/10] add name attribute to dog object --- basics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basics.js b/basics.js index 7f1bbcf..bcf70ce 100644 --- a/basics.js +++ b/basics.js @@ -32,4 +32,6 @@ var person = { * it should have a `bark` function that makes your dog bark! * It should also have a name attribute with the value of 'Spot' */ - var dog = {}; + var dog = { + name: "Spot" + }; From e7acedf91bd3dfdb7b07313bf5f9589deb5bc03d Mon Sep 17 00:00:00 2001 From: Lisa Date: Sun, 1 May 2016 21:07:29 -1000 Subject: [PATCH 08/10] add bark attribute to dog object --- basics.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basics.js b/basics.js index bcf70ce..c2bf053 100644 --- a/basics.js +++ b/basics.js @@ -33,5 +33,8 @@ var person = { * It should also have a name attribute with the value of 'Spot' */ var dog = { - name: "Spot" + name: "Spot", + bark: function(){ + console.log("Bark! Bark!"); + } }; From 5cf4ecde042cfdbab430480a17875c3ab72bd16a Mon Sep 17 00:00:00 2001 From: Lisa Date: Mon, 2 May 2016 22:59:37 -1000 Subject: [PATCH 09/10] update 'canDrive' variable with comparison operator --- basics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basics.js b/basics.js index c2bf053..ff2adfa 100644 --- a/basics.js +++ b/basics.js @@ -13,7 +13,7 @@ var person = { /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old */ - var canDrive = true; + var canDrive = person.age >= 16; /* Create a function called `greet`, * it should take a 1 parameter, `name` From 94545375d93788edcad6319ec65089aa5b213147 Mon Sep 17 00:00:00 2001 From: Lisa Date: Mon, 2 May 2016 23:08:29 -1000 Subject: [PATCH 10/10] update 'myName' variable with actual string data --- basics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basics.js b/basics.js index ff2adfa..92b0ab8 100644 --- a/basics.js +++ b/basics.js @@ -1,5 +1,5 @@ /* Create a `myName` variable and assign it a String value */ -var myName = ""; +var myName = "Lisa"; /* Create a `person` variable and give it 2 properties, * `name`, assign it the same name as before,