Why is <0.66 sufficient?


var userChoice = prompt("Do you choose rock, paper or scissors?")

var computerChoice = Math.random()

if (computerChoice <= 0.33 ){
else if (computerChoice <= 0.66){


The program above works but is not relevant to the question. it is asking the random number between 0.34 and 0.66 to output 'paper' , for example. But takes condition <= 0.66 , which covers 0 to 0.66, which would actually be wrong.

My computerChoice output does not correlate to Math.random?

If it is not related to a question than please open a new topic. I hope you like the title, if not feel free to change it.

On your question think about under which conditions the else if case is even evaluated maybe.
Also you're meant to change the value of computerChoice not to console.log something.