26 lines
405 B
JavaScript
26 lines
405 B
JavaScript
var age, ref;
|
|
|
|
age = prompt("How old are you?", 0);
|
|
|
|
if (age >= 18) {
|
|
alert('Adult');
|
|
} else {
|
|
alert('Under 18');
|
|
}
|
|
|
|
if (age < 15) {
|
|
alert('Under 15');
|
|
}
|
|
|
|
if (age < 16) {
|
|
alert("Under age");
|
|
} else {
|
|
alert("Of age");
|
|
}
|
|
|
|
// Doesn't do what one would expect. At all. Look at the JS.
|
|
console.log((ref = age < 15) != null ? ref : {
|
|
"Minor": "Elder"
|
|
});
|
|
|
|
//# sourceMappingURL=3-1-conditions.js.map
|