Expected an identifier and instead saw 'else'. Missing semicolon in JavaScript -


this code have atm. "expected identifier , instead saw 'else'. missing semicolon." "else" in -

if(fight === "fight"); {     alert("you fought pikachu , won!"); } else {     alert("you ran pikachu , got away saftey"); } 

should obvious error message, if statement not end semicolon.

replace

if(fight === "fight"); // <- syntax error {     alert("you fought pikachu , won!"); } else 

with

if(fight === "fight") {     alert("you fought pikachu , won!"); } else 

as shortening, start removing uneccessary switch / case -> http://jsfiddle.net/adeneo/nank9/


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -