forked from tanham/js-rocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexplanation.js
66 lines (51 loc) · 988 Bytes
/
explanation.js
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
//Variable Explanation
var favColor = "green";
var myFavColors = ["green, purple, yellow"];
var numOfFavColors = 3;
var hasGotFavColor = true;
var myObject = {
firstName: "Tanisha",
lastName: "Hampden",
favColors: ["green, purple, yellow"],
yearsAlive: 25,
isFemale: true,
};
//Function Explanation
Function whatIsMyFavColor () {
}
var whatIsMyFavColor = function () {
return "green";
}
var doSomething = function () {
console.log("do Something!!!");
}
var area = function (width, height) {
return width * height;
}
var fullName = function (firstName, secondName) {
return firstName + " " +secondName;
}
var myName = "Tanisha";
//if-else statement Explanation
if (true) {
//do something
alert("female");
};
var number1 = 10;
var number2 = 100;
if (number2 > number1) {
//do something
alert(true);
}
else {
alert(false);
}
var name1 = "Tan";
var name2 = "Ham";
if (name2 == "Ham" && name1 == "Tan") {
//do something
alert(true);
}
else {
alert(false);
}