Syntax Error: Unexpected end of input


#1

There is an error in below program??
Error:: Syntax Error: Unexpected end of input
How to solve the error??

var game = function(input){
if(input == "Rock")
{
return "Rock";
}
else if(input == "Paper")
{
return "Paper";
}
else {
return "Scissor";
}
var input= "Rock";

game("Rock");


#2

You never close out your function. Add a "}" after your final else statement.


#3

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