diff --git a/README.md b/README.md index c8d2d5c..a48b622 100644 --- a/README.md +++ b/README.md @@ -5,24 +5,34 @@ #### Assume your present working directory is `$ ~/buffy` 1. Make two directories inside `~/buffy`: `scoobies` and `vamps` -


+ +pwd +mkdir scoobies vamps 2. Make files in `scoobies` named `buffy.txt`, `giles.txt` and `angel.txt` -


+ +cd scoobies +touch buffy.txt giles.txt angle.txt 3. Copy `angel.txt` into the `vamps` directory -

+ +pwd // assume I'm in scoobies directory +cp angle.txt ~/wdi17/checkpoint/checkpoint1/vamps/ + 4. Delete the `vamps` directory and everything inside it -

-### JS Variables +cd .. +rm -rf vamps +### JS Variables +(pls see JS file) 1. Assign the string "Jack" to a variable called `captain` -

+ + 2. Using the `captain` variable, use string concatenation to form the string "Oh Jack, my Jack!", assigning it to a variable named `phrase` -

+ ### JS Conditionals diff --git a/app.js b/app.js new file mode 100644 index 0000000..b3c58a3 --- /dev/null +++ b/app.js @@ -0,0 +1,96 @@ +console.log('checkpoint') + + +/* +#### Assume your present working directory is `$ ~/buffy` + +1. Make two directories inside `~/buffy`: `scoobies` and `vamps` + +pwd +mkdir scoobies vamps + +2. Make files in `scoobies` named `buffy.txt`, `giles.txt` and `angel.txt` + +cd scoobies +touch buffy.txt giles.txt angle.txt + +3. Copy `angel.txt` into the `vamps` directory + +pwd // assume I'm in scoobies directory +cp angle.txt ~/wdi17/checkpoint/checkpoint1/vamps/ + + +4. Delete the `vamps` directory and everything inside it + +cd .. +rm -rf vamps +*/ + + +// JS Variables + +1. + +var captain; + +captain = 'Jack'; + +2. + +var phrase = 'Oh ' + captain + ', my ' + captain + "!"; + +// JS conditionals + +1. + +var souls = 3; +var lifeRafts = 2; + +if (souls > lifeRafts) { + console.log ("SOS"); +} + +// Data Structures - JS Arrays + +var weekend = ['Saturday']; + +weekend.push('Sunday'); + +weekend.unshift('Friday'); + +var day = weekend[1]; + +weekend.shift(); + + +// Data Structures - JS Objects + +var brain = { + energyLevel: 10 +}; + +var energy = brain.energyLevel; + +brain.dream = 'electric sheep'; + +brain.dayDream = { + lunch: ['burger', 'beer'] +}; + +brain.dayDream.lunch.push('pudding'); + + +// JS Functions + +function areaOfRect(height, width) { + return height * width; +} + +var result = areaOfRect(3, 4); + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..e69de29