RPS Syntax Error =(


var Urpick = prompt("Rock? Paper? Scissors?")
var game = function (Urpick){
    {if (Urpick===rock)
        console.log("You Lose");
    {else if(Urpick===scissors)
        console.log("You win");
        console.log("You Lose");


you misplaced the opening { for the if, else if and else
The opening { should be placed after the condition. Then, in the conditions, you should place " " around rock, scissors and paper because it looks like Urpick is a string, like so

if (Urpick==="rock") { # don't forget the " " around rock and move the opening {
  some code
else if (...) { ... }

You should not give any condition for the else because it is the escape route if all the other conditions were not met:

        console.log("You Lose");

Moreover, you called your function game at the last line without giving it the required parameter, like so




Awesome ty so much I will see if it works thanks alot.


It Worked ty very much now I can sleep in peace