Skip to content

Commit 00122e1

Browse files
committed
Chapter 6 - Q3
1 parent b38fff3 commit 00122e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Chapter 6/Practice Set/29_PracticeSet.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ while(runAgain){
88
let age = prompt("Enter your age:")
99
age = Number.parseInt(age)
1010

11+
if(age<0){
12+
console.error("User entered the negative value. Please enter the valid age.")
13+
break;
14+
}
15+
1116
if(canDrive(age)){
1217
alert("You can drive")
1318
}

0 commit comments

Comments
 (0)