Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit c3d4384

Browse files
committed
comitting exercises
comitting answers to exercises
1 parent db1f51c commit c3d4384

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

week-2/1-exercises/D-predicates/exercise.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
// Finish the predicate function to test if the passed number is negative (less than zero)
99
function isNegative(number) {
10-
10+
return number < 0;
1111
}
1212

1313
// Finish the predicate function to test if the passed number is between 0 and 10
1414
function isBetweenZeroAnd10(number) {
15-
15+
return number > 0 && number < 10;
1616
}
1717

1818
/*
@@ -32,4 +32,3 @@ console.log("Is the number between 0 and 10? " + numberBetweenZeroAnd10);
3232
Is the number negative? false
3333
Is the number between 0 and 10? true
3434
*/
35-

week-2/1-exercises/E-conditionals/exercise.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
var name = "Daniel";
1010
var danielsRole = "mentor";
11+
if (danielsRole) {
12+
console.log(`Hi, I'm ${name} , I'm a ${danielsRole}`);
13+
} else {
14+
console.log(`Hi, I'm ${name} , I'm a student`);
15+
}
1116

1217
/*
1318
EXPECTED RESULT

week-2/1-exercises/F-logical-operators/exercise.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var cssLevel = 4;
1111

1212
// Finish the statement to check whether HTML, CSS knowledge are above 5
1313
// (hint: use the comparison operator from before)
14-
var htmlLevelAbove5;
15-
var cssLevelAbove5;
14+
var htmlLevelAbove5 = 5;
15+
var cssLevelAbove5 = 5;
1616

1717
// Finish the next two statement
1818
// Use the previous variables and logical operators
@@ -27,10 +27,7 @@ var cssOrHtmlAbove5;
2727
console.log("Is Html knowledge above 5?", htmlLevelAbove5);
2828
console.log("Is CSS knowledge above 5?", cssLevelAbove5);
2929
console.log("Is Html And CSS knowledge above 5?", cssAndHtmlAbove5);
30-
console.log(
31-
"Is either Html or CSS knowledge above 5?",
32-
cssOrHtmlAbove5
33-
);
30+
console.log("Is either Html or CSS knowledge above 5?", cssOrHtmlAbove5);
3431

3532
/*
3633
EXPECTED RESULT

0 commit comments

Comments
 (0)