Calling compare function incorrectly


What if choice1 is scissors?

Make sure to call your compare function with userChoice and computerChoice as the arguments!

var compare=function(choice1,choice2)
{if (choice1===choice2)
return "The result is a tie!"
else if ( choice1==="rock")
{ if( choice2==="scissors")
 {return "rock wins";}
 {return"paper wins";}}
 else if (choice1==="paper")
{if (choice2==="rock")
 {return "paper wins";}
 else {return "scissors wins"}}
 else if (choice1==="scissors")
 { if (choice2==="rock")
  {return "rock wins";}
  else {return "scissors wins"}}}


Hi you should call your function compare with userChoice and computerChoice


Please provide a syntax example how should I call that function..just an example by taking any random choice of userChoice and computerChoice


can you post all your code?


Okay it..I was just doing putting in value of user choice like compare("rock",computerChoice)...Now i got it I had to put userChoice instead of rcok..It bad