forked from epoch/checkpoint1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
96 lines (50 loc) · 1.23 KB
/
app.js
File metadata and controls
96 lines (50 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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);