From 66b1109abcc60484d8a3f5590242ad87f78207e1 Mon Sep 17 00:00:00 2001 From: javenkn Date: Mon, 2 May 2016 00:23:42 -1000 Subject: [PATCH 1/2] finished all until #greet --- basics.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/basics.js b/basics.js index 94aaf06..9dc57cd 100644 --- a/basics.js +++ b/basics.js @@ -1,19 +1,37 @@ /* Create a `myName` variable and assign it a String value */ +var myName = "Javen"; + /* 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: "Javen", + age: 21 +}; + /* 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){ + canDrive = true; +}else{ + canDrive = false; +} + /* 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); */ From bc863a3dcb319e3cc2783382bf80eb83866a7d25 Mon Sep 17 00:00:00 2001 From: javenkn Date: Mon, 2 May 2016 00:48:33 -1000 Subject: [PATCH 2/2] finished everything --- basics.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/basics.js b/basics.js index 9dc57cd..34e2dd0 100644 --- a/basics.js +++ b/basics.js @@ -35,8 +35,18 @@ function greet(name){ /* Create an array called `dataTypes` with atleast 1 of every data type; * (there are 6 different data types); */ +var object = { + array: 6 +}; +var dataTypes = [1, 'string', true, undefined, object, null]; /* 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("bark!"); + } +}