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
Post a Comment