RPS Syntax Error =(


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```

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");
}
{else(Urpick===paper)
    
    console.log("You Lose");
}

}
game

<do not remove the three backticks above>

#2

Hi
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:

else
{        
        console.log("You Lose");
}

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

game(Urpick)

Cheerio


#3

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


#4

It Worked ty very much now I can sleep in peace