Build "Rock, Paper, Scissors" part 1


#1

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
console.log(computerChoice);

it says:

TypeError: console.log is not a function


#2

I think that the code works fine. Try to refresh the page.


#3

after a few times refreshing it worked! Still u try 2 figure out it there's something wrong. Thanks 4 ur reply!


#4

There is nothing wrong. The code is ok : )


#5

This often happens when you use console.log = (...) instead of console.log(...). In this case console.log is overwritten with the new value and is therefore no longer a function. So even if you fix this you'll get the error message, now by refreshing the page the JS is reset and so the console.log gets its built-in functionality again.


#6

Thanks for explaining this!