Unexpected EOF? Help please


#1

var user = prompt("What's your name?").toUpperCase();
var age = prompt("What's your age?");
var deadlyNumber = Math.random;
switch(user){
    case("John"):
        console.log("die");
        break;
    case("Jim" || "Tim"):
        console.log("Die);
        break;
    case("Sal"):
        console.log("Taco");
        break:
    default:
    console.log("Hi")
}
if (age && deadlyNumber * 10 > 5){
    console.log("Dead");
} else {
    console.log("you live");
}
};

#2

@maxb55555

In terms of syntax you do have some errors:

1) Missing speech mark for "Die":
case("Jim" || "Tim"):
console.log("Die);
break;

2) You put a colon ":" instead of ";" (semi-colon) after break:
console.log("Taco");
break:
default:

3) Extra curly bracket and semi-colon right at the end:
if (age && deadlyNumber * 10 > 5){
console.log("Dead");
} else {
console.log("you live");
}
};

4) Missing a semi-colon after the console.log here:
default:
console.log("Hi")
}

After that your code should be fine in terms of syntax. It should look like this:

var user = prompt("What's your name?").toUpperCase();
var age = prompt("What's your age?");
var deadlyNumber = Math.random;
switch(user){
case("John"):
console.log("die");
break;
case("Jim" || "Tim"):
console.log("Die");
break;
case("Sal"):
console.log("Taco");
break;
default:
console.log("Hi");
}
if (age && deadlyNumber * 10 > 5){
console.log("Dead");
} else {
console.log("you live");
}

Although I don't know what your code is actually supposed to do...

Hope that helps!