Stuck on 'Switch' Code Your Own Adventure 2 JavaScript


#1

I'm not sure what's wrong with my code here

var user = prompt("What do you do when attackd by a wild turkey?").toUpperCase();
switch(user){
case 'RUN':
console.log("He's a chasing you now!");
break;
case 'ATTACK HIM':
console.log.("He's attacking back!");
break;
case 'NOTHING':
console.log("He's gobbling");
break;
default:
console.log("The turkey lays flat on the ground");
};

I've checked for semicolons and colons and I keep getting the error that there's a problem with my Syntax "There was a problem with your syntax." Any idea what's going on? Any help is appreciated!!


#2

There are paid advisors to deal with these issues. We are not really able to address Pro concerns. Sorry.


#3

Just check your syntax again.
pro-tip: nothing wrong with colons or semicolons


#4

Checking syntax is easier when you are using an app that helps you out a bit. Have a look at the indicators in the column before the line numbers.

https://repl.it/DhpW


#5

Thanks I've found the 'console log' period from an advisor who pointed it out. It was right after the word log. Thank you for the resource @albionsrefuge it was very helpful as well to use the app! I will be using this in the future.


#7