File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,15 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
2828 *
2929 * 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.
3030*/
31-
31+ function canVote ( age ) {
32+ if ( age >= 18 ) {
33+ return "true"
34+ } else {
35+ return "false"
36+ }
37+ }
38+ var votingAge = canVote ( 18 ) ;
39+ console . log ( votingAge ) ;
3240
3341/*
3442 * #2
@@ -41,7 +49,15 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
4149 * The function will return the message: "Login Success!", if the string passed into the function is "test1234"
4250 * Console.log your result.
4351*/
44-
52+ function login ( password ) {
53+ if ( password === "test1234" ) {
54+ return "Login Success!"
55+ } else {
56+ return "get out!"
57+ }
58+ }
59+ var kenny = login ( "test124" )
60+ console . log ( kenny ) ;
4561
4662/*
4763 * #3
You can’t perform that action at this time.
0 commit comments