What is wrong with my code?


#1

var userChoice=prompt("Do you choose rock, paper, scissors?")
var computerChoice=Math.random();
console.log(computerChoice);
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";
}

#2

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?");
console.log(userChoice);

var computerChoice = Math.random();

console.log(computerChoice);
if (computerChoice<=0.33) {
       alert("Rock");
} else if ((computerChoice>=0.34) & (computerChoice<=0.66)) {
       alert("Paper");
} else {
       alert("Scissor");
}

#3

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:
http://www.sitepoint.com/javascript-truthy-falsy/
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:

computerChoice=0.34,0.66

has a value of 0.66 which is true no matter what computerChoice is, was or is changed to.
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Operators/Comma_Operator

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) {
 computerChoice="rock";
} else if (computerChoice< 2/3) {
computerChoice="paper";
} else {
  computerChoice="paper";
}

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