SyntaxError: unterminated string literal -- what does this mean?


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/4?curriculum_id=506324b3a7dffd00020bf661#


SyntaxError: unterminated string literal


var user = prompt("Are your shoes GREEN, YELLOW, or PURPLE?").toUpperCase();
switch (user) { 
   case"GREEN":
   var tree = prompt("Do you want a tree (YES or NO)?").toUpperCase();
   var plant = prompt("Do you want a plant?").toUpperCase();
   if(tree === "YES" || plant === "YES") {
       console.log("You win your choice!");
   }
   else {
       console.log("You can't win both! Go back and pick tree or plant.");
   }
   break;
   
   case"YELLOW":
   var happyFaceSticker = prompt("Happy Face sticker (YES or NO)?").toUpperCase();
   var yellowSilkScarf = prompt("Yellow silk scarf?").toUpperCase();
   if(happyFaceSticker === "YES" || yellowSilkScarf ==="YES") {
       console.log("Excellent choice! We'll mail it to you.");
   }
   else {
       console.log("You can only have one. Select the happy face or the scarf.");
   }
   break;
   
   case"PURPLE":
   var purpleRainAlbum = prompt("Purple Rain Album (YES or NO)?").toUpperCase();
   var standUp = prompt("Standup of Prince?").toUpperCase();
   if(purpleRainAlbum === "YES" || standUp === "YES") {
       console.log("Your choice will be mailed tomorrow.");
   }
   else {
       console.log("Select the album or the stand up.);
   }
   break;
   
   default:
     console.log("I didn't understand your choice. Select a shoe color.");
}


#2

console.log("Select the album or the stand up.); // here you didn't close string

#3

Thank you. I see it now.


#4

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