From 1006e8e7957ef77c9e09d2446287e49a7d1d88c6 Mon Sep 17 00:00:00 2001 From: Oksana Harr Date: Mon, 12 Jun 2017 20:16:09 -1000 Subject: [PATCH] finished --- basics.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/basics.js b/basics.js index 94aaf06..eee0851 100644 --- a/basics.js +++ b/basics.js @@ -1,24 +1,51 @@ /* Create a `myName` variable and assign it a String value */ +var myName = "Oksana"; + /* 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: "Oksana", + age: 25 + }; + /* 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; +} + /* 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 = ["string", 1, true, {name: "Oksana"}, undefined, 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 = { + breed: "pitbull", + name: "Spot", + bark: function(){ + console.log("Bark! Bark!");} +};