More practice with Switch


Hi there

I don`t know why it is showing this message: ReferenceError: countries is not defined

I am sure I did everything right. Please help! Thanks

var answer = prompt("Which countries have you ever been to?");

switch (countries) {
case 'Chile':
    console.log("Only for a day");
    case 'Argentina':
    console.log("honey moon");
    case 'Australia':
    console.log("In 2013");
    console.log("Next one to EUA");
  // Add your code here!


yes you prompt the user to name a country and store it in a variable named answer. And then you use countries instead of answer in the switch.


Hi there

I as well, do not know what's wrong with my code and it kept showing this message : Oops, try again. There was a problem with your syntax.
I checked over and over again to see where I went wrong but in the end I couldn't find the mistakes.
Please help me!
Thank you in advance.

var userAnswer = prompt("What is your favourite movie?/ Type in common letters please.");

    case 'now you see me':
    console.log("Yeah, I love that movie especially the part where the hypnosis guy tells the tale of the assistant french police lady. That was cool.");
    case 'now you see me 2':
    console.log("Bruh, I dig that movie. KFC: Ah eat that. Your Xs number: ah own that. Now you see me 2: AH WATCH THAT!");
    case 'angry birds':
    console.log("That movie was cool and all. Especially when the Guidance Counsellor beat up those piggies. She was like,'I'm gonna kick your ass to the night before!' Yeah she's cool.");
    case 'zootopia':
    console.log("I like that movie its full of animals. But you know what I don't like about that movie! They are all racist! Not a single ape black animal confirmed throughout the movie.");
    case 'batman vs superman':
    console.log("Batman would have won! He was all over superman! But did you know? Superman didn't really die in the end! I'm telling you he's freakin' BAF.");
    console.log("Doug you must be crazy, There ain't no " + userAnswer "movie. You lyeing.");


your missing a "+" after userAnswer and before "move...".


Thank you so much!
I type it in and it actually worked!
God bless you!


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