Whats wrong with my codes :(?


var userChoice= prompt("Do you choose rock, paper or scissors?");
var computerChoice= Math.random();
if (computerChoice<=0.33) {
computerChoice="rock .";
else if (computerChoice<=0.67){
computerChoice"paper .";
else {
computerChoice= "scissors .";


You have additional information in your string. You are looking for the pc to return "scissors ." when it is returning "scissors"
That extra little space and dot are throwing you off.

Additionally you need to add in the keyword -return-


sorry but i didnt get it


var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie";

and what about this ?

else if (computerChoice<=0.67){
computerChoice"paper .";

should be

else if (computerChoice<=0.67){
          computerChoice = "paper";

There were two changes I made here. I added the = and took " ." out of the new value for computerChoice. The other two parts of your if/elseif/else statement only need the " ." removed.

Also, you'll find it more useful to log computerChoice after converting it to rock, paper, or scissors, rather than while still a number.

What are you asking about the compare function?


hey thank you man very mush
the compare instructions work well ... i ve just forgot to put "!" on my sentence .
this is a weak point in this wonderfull web page ( that you need to write the same instruction as the tutor made )


Also don't use semicolons after the } of your conditions that can cause errors and the reasons is explained in this post: