Skip to content

Commit 9ff9c80

Browse files
author
AmiyahJo
committed
feat: canVote age one liner
changed my original if else statement to a simple one line code
1 parent ff25c09 commit 9ff9c80

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import { computeLexicographicDistance } from "./util.js";
77
* @return True if the age corresponds to a voting age and false otherwise.
88
*/
99
export function canVote(age: number): boolean {
10-
if (age >= 18){
11-
return true;
12-
}
13-
return false;
10+
return age >= 18;
11+
// if (age >= 18){
12+
// return true;
13+
// }
14+
// return false;
1415
}
1516

1617
/**

0 commit comments

Comments
 (0)