Unexpected EOF error


#1

Can someone pls help spot the error here?

var answer = prompt("Are you ready to take us to the
top?");

switch(answer) {
case 'Yes':
console.log("Alright my friend! Let's do this");
break;
case 'no':
console.log("C'mon! Let's do this!");
break;
default:
console.log("Show us some enthusiasm. Let's do this!");
break;
}


#2

TRY

var answer = prompt("Are you ready to take us to the top?").toLowerCase();

switch(answer) {
    case 'yes':
        console.log("Alright my friend! Let's do this");
        break;
    case 'no':
        console.log("C'mon! Let's do this!");
        break;
    default:
        console.log("Show us some enthusiasm. Let's do this!");
        break;
}

You problem is on this line

var answer = prompt("Are you ready to take us to the
top?");

JavaScript uses the semicolon to signify the termination of a line(i.e. you are done with that line). in your case you have an incomplete sting sequence hence the parser will halt when it gets there.