From 93b3b3a95ed5bfa061ccbfe35baf36f6dd64f32d Mon Sep 17 00:00:00 2001 From: Sheena Galutira Date: Sun, 1 May 2016 18:08:52 -1000 Subject: [PATCH 1/3] myName variable --- basics.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/basics.js b/basics.js index 94aaf06..88dc923 100644 --- a/basics.js +++ b/basics.js @@ -1,5 +1,7 @@ /* Create a `myName` variable and assign it a String value */ +var myName = "sheena"; + /* Create a `person` variable and give it 2 properties, * `name`, assign it the same name as before, * as well as an `age` (number); From faa638feaaa41e8a13562bf44f966fd3c71a6409 Mon Sep 17 00:00:00 2001 From: Sheena Galutira Date: Tue, 3 May 2016 01:04:16 -1000 Subject: [PATCH 2/3] Completed basics.js --- basics.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/basics.js b/basics.js index 88dc923..b5f4aca 100644 --- a/basics.js +++ b/basics.js @@ -7,20 +7,41 @@ var myName = "sheena"; * as well as an `age` (number); */ + var person = {name: "sheena", age: 30}; + /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old */ +if (person.age >= 16){ + var canDrive = true; +} + /* Create a function called `greet`, * 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); + } + greet("sheena"); /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ + var dataTypes = ['string', 10, true, {food:"taco", drink:"water"}, ['red', 'green','blue'], null, undefined]; /* 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' */ + var dog = { + name:"Spot", + bark: function(){ + console.log("woof woof"); + } +}; + +dog.bark(); + + From 688f5dc60c0c26594c47c47339bc2900ed45dba7 Mon Sep 17 00:00:00 2001 From: sgalutira Date: Wed, 4 May 2016 23:42:36 -1000 Subject: [PATCH 3/3] woof --- basics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basics.js b/basics.js index b5f4aca..68a5b34 100644 --- a/basics.js +++ b/basics.js @@ -7,7 +7,7 @@ var myName = "sheena"; * as well as an `age` (number); */ - var person = {name: "sheena", age: 30}; + var person = {name: myName, age: 30}; /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old @@ -24,7 +24,7 @@ if (person.age >= 16){ function greet(name){ console.log("Hello, my name is " + name); } - greet("sheena"); + greet(person.name); /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types);