const canDrive = (age)=> {
return age>=18?true:false;
}
let promptAgain = true;
while (promptAgain) {
let age = prompt(`Enter age`);
age = Number.parseInt(age);
if (canDrive(age)) {
alert(`hey buddy! you can drive`);
} else {
alert(`oops! you can't drive`);
}
promptAgain = confirm(`Do you want to see prompt again.`);
}