Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completed quiz #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,34 @@
#### Assume your present working directory is `$ ~/buffy`

1. Make two directories inside `~/buffy`: `scoobies` and `vamps`
<br><br><br>

pwd
mkdir scoobies vamps

2. Make files in `scoobies` named `buffy.txt`, `giles.txt` and `angel.txt`
<br><br><br>

cd scoobies
touch buffy.txt giles.txt angle.txt

3. Copy `angel.txt` into the `vamps` directory
<br><br>

pwd // assume I'm in scoobies directory
cp angle.txt ~/wdi17/checkpoint/checkpoint1/vamps/


4. Delete the `vamps` directory and everything inside it
<br><br>

### JS Variables
cd ..
rm -rf vamps

### JS Variables
(pls see JS file)
1. Assign the string "Jack" to a variable called `captain`
<br><br>



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



### JS Conditionals
Expand Down
96 changes: 96 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -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);







Empty file added index.html
Empty file.