From 09672f9b17132eef83fd2730bde199f8cc2749b7 Mon Sep 17 00:00:00 2001 From: Christie R Date: Wed, 4 May 2016 10:48:48 -1000 Subject: [PATCH 1/2] I am done! :D --- basics.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/basics.js b/basics.js index 94aaf06..e91c7f0 100644 --- a/basics.js +++ b/basics.js @@ -1,24 +1,66 @@ /* Create a `myName` variable and assign it a String value */ +var myName = "Peter Piper"; + /* 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: "Peter Piper", + age: 18 +}; + /* Create a variable called `canDrive`, * if it should be true if your person object is at least 16 years old */ +var canDrive; +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); +} + /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ +var dataTypes = +[ + true,//Boolean + null,//Null + undefined,//undefined + 8,//Number + "Hashbrown",//String + Banana = //Object + { + plum : 20, + potato: 20000000000 + } +]; + /* 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(name + "Woof"); + } + }; From 1ca66ae25aea3030f9eac8870ed571f832284183 Mon Sep 17 00:00:00 2001 From: Christie R Date: Wed, 4 May 2016 16:10:59 -1000 Subject: [PATCH 2/2] Now it's perfectttt :D --- basics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basics.js b/basics.js index e91c7f0..c78b9eb 100644 --- a/basics.js +++ b/basics.js @@ -18,7 +18,7 @@ var person = */ var canDrive; -if (person.age > 16) +if (person.age >= 16) { var canDrive = true; }