Skip to content

Commit 63e1268

Browse files
authored
Merge pull request #406 from snakecase/patch-2
Fix check for an empty input or ESC key press
2 parents d16fb05 + 6410140 commit 63e1268

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/02-first-steps/10-ifelse/4-check-login/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ if (userName == 'Admin') {
99

1010
if (pass == 'TheMaster') {
1111
alert( 'Welcome!' );
12-
} else if (pass == null) {
12+
} else if (pass == '' || pass == null) {
1313
alert( 'Canceled.' );
1414
} else {
1515
alert( 'Wrong password' );
1616
}
1717

18-
} else if (userName == null) {
18+
} else if (userName == '' || userName == null) {
1919
alert( 'Canceled' );
2020
} else {
2121
alert( "I don't know you" );

0 commit comments

Comments
 (0)