const canDrive = (age)=> {
return age>=18?true:false;
}
let age = prompt(`Enter age`);
age = Number.parseInt(age);
if (age < 0)
console.error('age is negative');
else if (canDrive(age))
alert(`hey buddy! you can drive`);
else
alert(`you cannot drive`);