From 597372da46944bdb41609cbf1e85020b14603046 Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Sun, 1 May 2016 17:44:46 -1000 Subject: [PATCH 1/6] Created a variable for myName and person --- basics.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/basics.js b/basics.js index 94aaf06..b8d692b 100644 --- a/basics.js +++ b/basics.js @@ -1,14 +1,22 @@ /* Create a `myName` variable and assign it a String value */ +var myName = 'Nikki'; + /* Create a `person` variable and give it 2 properties, * `name`, assign it the same name as before, * as well as an `age` (number); */ +var person = { + name: 'Nikki', + age: 27 +}; /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old */ +var canDrive = 16; + /* Create a function called `greet`, * it should take a 1 parameter, `name` * and it should print "Hello, my name is {name}" From 9d37ee493be965a2154e6443f070ee6d34e94bfe Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Sun, 1 May 2016 20:30:30 -1000 Subject: [PATCH 2/6] Finished the canDrive variable --- basics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basics.js b/basics.js index b8d692b..911f0bd 100644 --- a/basics.js +++ b/basics.js @@ -15,7 +15,7 @@ var person = { * if it should be true if your person object is at least 16 years old */ -var canDrive = 16; +var canDrive = person.age>=16; /* Create a function called `greet`, * it should take a 1 parameter, `name` From 1b16c14e106a64184ad86d01ec6b49987f430d4b Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Sun, 1 May 2016 22:25:48 -1000 Subject: [PATCH 3/6] Finished the dataTypes Array --- basics.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/basics.js b/basics.js index 911f0bd..887a93d 100644 --- a/basics.js +++ b/basics.js @@ -22,10 +22,18 @@ var canDrive = person.age>=16; * and it should print "Hello, my name is {name}" */ +function greet(name){ + return "Hello, my name is " + person.name; +} + +console.log(greet); + /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ +dataTypes = ["",{},[],'',(5<0),null,undefined,0]; + /* Create a `dog` object * it should have a `bark` function that makes your dog bark! * It should also have a name attribute with the value of 'Spot' From ba130a03fad5510aeadbe80a4353d7d846a65f70 Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Sun, 1 May 2016 22:30:19 -1000 Subject: [PATCH 4/6] Finished creating a greet function --- basics.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/basics.js b/basics.js index 887a93d..e1d5bec 100644 --- a/basics.js +++ b/basics.js @@ -23,18 +23,19 @@ var canDrive = person.age>=16; */ function greet(name){ - return "Hello, my name is " + person.name; + // return "Hello, my name is " + name; + console.log("Hello, my name is " + name); } -console.log(greet); - /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ -dataTypes = ["",{},[],'',(5<0),null,undefined,0]; +dataTypes = ["",{},(5<0),null,undefined,0]; /* Create a `dog` object * it should have a `bark` function that makes your dog bark! * It should also have a name attribute with the value of 'Spot' */ + + From 5edbb14490bc58e664f9090117f41b7ce6a0c24d Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Sun, 1 May 2016 23:12:14 -1000 Subject: [PATCH 5/6] Created a dog object --- basics.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basics.js b/basics.js index e1d5bec..9bea786 100644 --- a/basics.js +++ b/basics.js @@ -38,4 +38,8 @@ dataTypes = ["",{},(5<0),null,undefined,0]; * It should also have a name attribute with the value of 'Spot' */ +var dog = { + name: 'Spot', + speaks: 'Woof' +}; From 48dc84475e1e91f4fcc893781715056bdcafb09e Mon Sep 17 00:00:00 2001 From: Nikki Y Kobayashi Date: Mon, 2 May 2016 19:13:20 -1000 Subject: [PATCH 6/6] Made the dog bark --- basics.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/basics.js b/basics.js index 9bea786..1dce6fc 100644 --- a/basics.js +++ b/basics.js @@ -39,7 +39,11 @@ dataTypes = ["",{},(5<0),null,undefined,0]; */ var dog = { - name: 'Spot', - speaks: 'Woof' + name:'Spot', + bark:function(){ + console.log(this.name); + } }; + +