Log computerChoice to console having problems


#1

So i have tried this multiple times. I know this is right. I have looked in multiple places and found that this is the right code. It is logging my console.log as a function for some reason not quite sure why

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


#2

This line actually overwrites console.log with the number stored in computerChoice. So get rid of the = and refresh the page to reset console.log otherwise it will tell you that it is not a function (because now it is a number).


#3

gotcha. I went to another section, came back and saw that it had not cleared my code. Didn't know i had to "reset" my code if i got it wrong. Anyways thanks for the tip. Got it fixed now.


#4

You don't always need to do this, but in this case you overwrote the "printing stuff to console"-ability of console.log with a number and refreshing the page resets it otherwise console.log would be treated as a number and then console.log() would not be allowed and would not do what you suppose it to do.