All On Your Own - Missing Name After . Operator


#1


More on Control Flow in JS: All On Your Own


SyntaxError: missing name after . operator


var q = prompt("What's coming down the road?");


switch(q) {
    case "crabmab":
        console.log("Oh no!");
        break;
    case "zombie":
        console.log("RUH ROH!");
        break;
    case "dragon":
        console.log.("GG.");
        break;
    default:
        console.log("That's not a monster... It's a PC!");
};.


#2

delete the extra "." inbetween log and (


#3

There is a stray full stop (period) that should be removed.


#4

you shouldn't have a "." after the semicolon either.


#5

Thanks to both you and MTF -- I removed the full stop after the console log and that did the trick. ...Curiously, that period at the VERY END isn't in my code, but when I copy it into a question (just tried it), the period renders. And there isn't a period after the backticks. Huh. Thanks guys!!!


#6

no problem I'm happy to help.


#7

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