Logical Operations (Code Your Own Adventure 2! (5/6))


#1

Hi. I'm getting an error for my code:

var user = prompt("How many miles are you running?").toLowerCase();

switch(user) {
    case 10:
        console.log("Awesome!");
        break;
    case 13.1:
        console.log("Half-marathon, eh?");
        break;
    case 26.2:
        console.log("You're a marathon man!");
        break;
    case 9.9:
        if (miles || 9.9) {
        console.log("Too much for me, man!");
        }
        else { 
            console.log("I think I can keep up with you.");
        }
        break;
    case 100:
        if (miles && user === true) {
            console.log("Speechless.");
            else {
                console.log("What is your day job?");
            }
            break;
                
    default:
        console.log("Off day?");
        
}

The error message reads: "SyntaxError: expected expression, got keyword 'else'".

What am I doing wrong? And, how would you write the above code? Thanks.


#2

This if statement is not closed