Question about practice with SWITCH


#1

I pass practice with this code:

var answer = prompt("What is your favorite number?");

switch(answer) {
case "one":
console.log("fine, me too!");
break;
case "two":
console.log("ooo...!");
break;
case "three":
console.log("very bad...");
break;
case "four":
console.log("sorry...");
break;

default:
console.log("This is not a number...");

but first, I wanted to do this code with question "What's your favorite number" and put numbers(1,2,3,4...) instead strings (one, two...) so when user type he or she can type 1 instead "one"..
does anyone can help me how to do that...I would like to know..


#2

switch(parseInt(answer,10)) {
case 1:
    console.log("fine, me too!");
    break;
case 2:
    console.log("ooo...!");
    break;
case 3:
    console.log("very bad...");
    break;
case 4:
    console.log("sorry...");
    break;
default:
    console.log("This is not a number...");

#3

Thank You very much...and sorry, wasn't active for few days so I couldn't answer and give thanks to You.
I found this way reading topics and answers very useful and helpfull..thanks again.