This forum is now read-only. Please use our new forums! Go to forums
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
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?");
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
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…..
What line? I have the same trouble…