Compare values in switch case
by Checha Man
HTML
<title>Compare in switch case</title>
JavaScript
/*
http://stackoverflow.com/questions/32576618/switch-statement-to-compare-values-greater-or-less-than-a-number
*/
switch (true) {
case (age < 13):
alert("You must be 13 or older to play");
break;
case (age >= 13):
alert("You are old enough to play");
break;
}