Build "Rock, Paper, Scissors" part 1


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

it says:

TypeError: console.log is not a function


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


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


There is nothing wrong. The code is ok : )


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.


Thanks for explaining this!