What is wrong with my code?


var userChoice=prompt("Do you choose rock, paper, scissors?")
var computerChoice=Math.random();
if (computerChoice=0,0.33) {
 var computerChoice="rock";
} else if (computerChoice=0.34,0.66) {
var computerChoice="paper";
} else (computerChoice=0.67,1) {
 var computerChoice="paper";


You need to log both the Computer Choice and User Choice

Here is my code for example you only did console.log for the computer choice not the User One:

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

var computerChoice = Math.random();

if (computerChoice<=0.33) {
} else if ((computerChoice>=0.34) & (computerChoice<=0.66)) {
} else {


Well this doesn't work as expected. First of all avoid = in conditions, in javaScript = is the assignement operator and is not meant for comparison. So you don't check if computerChoice is for example 0 you make it become 0. If you dig deeper you will see that assignments have the value you assign so computerChoice=0 as a whole has a value of 0. So if you use this in a condition it is the same as using 0. If you now google a bit why this is not an error you may find this:
There you can see that 0 has a value of false when used in a condition and any other number would be true.
If you last but not least take into account what the comma-operator really does you'll see that for example:


has a value of 0.66 which is true no matter what computerChoice is, was or is changed to.

Oh and btw else doesn't have a condition on it's own.
Guess that is enough input for one post.
A little hint don't make it more complicated then it needs to be:

var computerChoice = Math.random();
if (computerChoice< 1/3) {
} else if (computerChoice< 2/3) {
} else {

would be fine. Also you only need var before the first time you use a variable.