7. more practice with the switch- number ranges?


#1


hello.
Can some1 show me how to properly do number parameters?
I get a pass when i run this code but the output is always the 'default'.

Any help is appreciated.


var answer = prompt("How old are you?");

switch(answer) {
  case answer<10:
    console.log("you are young");
    break;
    case 10<answer && answer<25:
        console.log("you are getting older");
        break;
        default:
        console.log("damn, u old");
        break;
  
}


#2

You should add if statement to your case so you can check conditions like this ^