This forum is now read-only. Please use our new forums! Go to forums
Why is this not working?
var userChoice = prompt(“Do you choose rock, paper or scissors?”); var computerChoice = Math.random(); console.log(computerChoice)
.
Anything I am doing wrong? It gives me error message:
Oops, try again. Your code doesn’t look quite right. Check the Hint if you need help!
Answer 55bda9a0e39efe899f00039c
This might work….!!!
userChoice = prompt(“Do you choose rock, paper or scissors?”); var computerChoice = Math.random() console.log(computerChoice);
Answer 55ba37d79113cb0fa500048a
Looks fine to me. Apart from a missing semicolon at the end of the code I can’t see any major errors. Try to reload the website (F5) or try another browser.
1 comments
Ya, I closed everything then I reloaded everything and it worked.
Answer 55c1998ed3292fffd100003b
Answer 55c86ed09376765a9e0001f8
This code either with or without semicolon (on the 2nd or 3rd row) pass me on. I think they should be there.
Answer 55e845d586f5521c1b0005ce
Insert new code outside function, it works :)
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
That’s exactly the same code the OP already posted. The only difference is that you forgot a semicolon in line 2 and the OP forgot one in line 3.
it still worked =/