This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by diksha123
almost 9 years

i am not getting 2/9

var game = function( choice1, choice2) { if ( choice1) { console.log(choice1 + “wins”); } else{ console.log(choice2 + “wins”); } } game(“rock”,”scissor”);

var userChoice = prompt("Do you choose rock, paper or scissors?");

Answer 555df13676b8fe447e0002c7

1 vote

Permalink

In 2/9 you are supposed to do the following:

 Declare a variable called userChoice.
 Make the variable equal to the answer we get by asking the user "Do you choose rock, paper or scissors?"

Therefore you only need this line of code:

var userChoice=prompt("Do you choose rock, paper or scissors?");
points
Submitted by schamanu
almost 9 years

2 comments

diksha123 almost 9 years

Really? I did that but the answer was not accepted so I had to add one more line of code and it got accepted now…..

Betsi_Trotvud almost 9 years

What line? I have the same trouble…