This repository was archived by the owner on Oct 26, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathexercise.js
More file actions
59 lines (49 loc) · 1.43 KB
/
exercise.js
File metadata and controls
59 lines (49 loc) · 1.43 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
/*
Logical Operators
---------------------------------
Using logical operators complete the unfinished statements.
The variables should have values that match the expected results.
*/
// Do not change these two statement
var htmlLevel = 8;
var cssLevel = 4;
// Finish the statement to check whether HTML, CSS knowledge are above 5
// (hint: use the comparison operator from before)
if (htmlLevel > 5) {
var htmlLevelAbove5 = true;
} else {false
}
if (cssLevel > 5) {
var cssLevelAbove5 = true;
} else {var cssLevelAbove5 = false;}
// Finish the next two statement
// Use the previous variables and logical operators
// Do not "hardcode" the answers
var cssAndHtmlAbove5;
var cssOrHtmlAbove5;
if (htmlLevel > 5 && cssLevel > 5) {
cssAndHtmlAbove5 = true;
} else {cssAndHtmlAbove5 = false}
if (htmlLevel > 5 || cssLevel > 5) {
cssOrHtmlAbove5 = true;
} else {
cssOrHtmlAbove5 = false;
}
/*
DO NOT EDIT BELOW THIS LINE
--------------------------- */
console.log("Is Html knowledge above 5?", htmlLevelAbove5);
console.log("Is CSS knowledge above 5?", cssLevelAbove5);
console.log("Is Html And CSS knowledge above 5?", cssAndHtmlAbove5);
console.log(
"Is either Html or CSS knowledge above 5?",
cssOrHtmlAbove5
);
/*
EXPECTED RESULT
---------------
Is Html knowledge above 5? true
Is CSS knowledge above 5? false
Is Html And CSS knowledge above 5? false
Is either Html or CSS knowledge above 5? true
*/