2. User Choice Is this right!?!?!?


#1


https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/2?curriculum_id=506324b3a7dffd00020bf661


SyntaxError: Unexpected token (


var userChoice(

After the "var userChoice(... do I put "Choice1 "paper")"
{
("Choice2"scissors")
{
result "sissors win over "paper"
}
else ("rock wins over sisors")

if I don't then what do I do!?!?!?!?


#2

@systemrunner55553

you think you can help me


#3

var userChoice("Choice1 "paper")
{
("Choice2"scissors")
{
result "sissors win over "paper"
}
else ("rock wins over sisors")

SyntaxError: Unexpected token (


#4

@systemrunner55553
@stetim94
what did I do wrong


#5

Step 1. You need to declare variable, for example: var someVariable;
Step 2. You need to put into the declared variable the user answer. For this goal you should to use prompt: prompt("Here should be the question");


#6

my variable is

var userChoice

where do I put the promt at????????


#7

Just assign prompt() to your variable userChoice using assign operator =.


#8

i don't understand could you put it in n example becausw I have o idea what you are talking about


#9

Here you can find an example:
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_state_switch4


#10

In that example prompt() was assigned to variable favDrink.


#11

I still don't understand


#12

just tell me exacly what to do!!!!!!! @denys.matsevych


#13

Step 1. You need to declare variable:

var userChoice; // I declared value

Step 2. You need to put into the declared variable the user answer.

var userChoice = prompt("Do you choose rock, paper or scissors?"); 
// I assigned prompt result to variable userChoice using assign operator =

#14

var userChoice("Choice1 "paper")
{
("Choice2"scissors")
{
result "sissors win over "paper"
}
else ("rock wins over sisors")

This is what I did. Where did I go wrong!?!?!


#15

Nevermind I found my mistake. Thanks.


#16

What lesson are you doing? Please, post link to the lesson. Because I looked at this:
https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/2?curriculum_id=506324b3a7dffd00020bf6612


#17

I'm on the next lesson now.


#18

You posted the link to the lesson and I thought you didn't do what instruction says. Have a nice codding!


#19

Thanks. What are you on?


#20

I have finished this JS course. Now I trying to learn React.