Syntaxerror!


#1


https://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661#
I can't find the error can someone help please ?

SyntaxError: Unexpected identifier


var user = prompt("You was walking one day and you found a book entitled Death Note , what do you do ? open it or throw it away or burn it");
switch(user){
 case 'open it':
      var choice = prompt(" You find some rules in the first page that says: Anyone who find this book is granted the power to kill. You can kill a person by writting its full name in this book.You can't kill a person if you don't know how it looks. What do you do ?THROW IT or START USING IT ");
  var vt = prompt( " What is the first person that you are willing to kill?TEACHER ? FRIEND ? CRIMINAL ? " );
  if (choice === START USING IT && vt === CRIMINAL){ 
   console.log( " You are a hero" );
} else if (choice===THROW IT || vt===FRIEND||vt===TEACHER){
   console.log( "Maybe someone else will use it" );
} else { 
   console.log( "Wrong choice" );}
    [break;]
 case ' throw it away ':
   console.log("Really ? Did not You find it weird ? ");
    [break;]
 case 'leave it':
   console.log("Good choice! Maybe it will disappear on its own ");
    [break;]
 default :
   console.log( "Your answer don't figure in the choices" );
    [break;]
}


#2

it has to do with your breaks. there aren't supposed to be [] around it


#3

actually there was no break but when i read the glossary i found that there was brackets there , even if i removed theme i still have the same problem . Thanks for the reply btw


#4

try removing the [ ] and the last break after the default. I think it might work. ive never seen a break with [ ] around it because [ ] means an Array. good luck :slight_smile:


#5

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