Skip to content

Commit 36b45c7

Browse files
Jess ManapulJess Manapul
authored andcommitted
completed devleagueprep#1
1 parent 43d80e7 commit 36b45c7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

exercises.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if(today === "Friday"){
77
return "Let's Party!";
88
};*/
99

10+
1011
/*
1112
If/else statements = Evaluates (or checks) a condition. If the condition is true, the first code block is executed. If the condition is false, the second code block is executed instead.
1213
*/
@@ -29,6 +30,13 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
2930
* The function will return true if the number passed into the function is equal to or greater than Hawaii's voting age. Console.log your result.
3031
*/
3132

33+
function canVote (age) {
34+
if (age > 17) return true;
35+
else return false;
36+
}
37+
38+
console.log(canVote(17));
39+
console.log(canVote(18));
3240

3341
/*
3442
* #2
@@ -43,6 +51,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
4351
*/
4452

4553

54+
4655
/*
4756
* #3
4857
* Function - isGreaterThan

0 commit comments

Comments
 (0)