5. Logical operators. SyntaxError: Unexpected token ILLEGAL



SyntaxError: Unexpected token ILLEGAL

var user = prompt("What do you want to do??").toUpperCase();

switch(user) {
    case 'FIGHT':
        var strong = prompt("Are you strong??").toUpperCase();
        var smart = prompt("Are you smart??").toUpperCase();
            if(strong === 'YES' || smart === 'YES') {
                console.log("You only need one of the two!);
            } else {
                console.log("You're not strong OR smart? You lose! You need tese both to win.");
    case 'RUN':
        var fast = prompt("Are you fast??").toUpperCase();
        var headStart = prompt("Did you get a head start?").toUpperCase();
    if(fast === 'YES' && headStart === 'YES') {
        console.log("You got away--barely!");
    } else {
        console.log("You're not fast and you didn't get a head start? You never had a chance!");
    console.log("I didn't understand your choice. Hit Run and try again, this time picking FIGHT or RUN!");


Hi this line you didn't close the string

console.log("You only need one of the two!);


Really?? :smiley: thank you. Tried to find the problem few hours :frowning:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.