Step four: Good afternoon codemen. Please tell me what is wrong with my code. Thankyou


Oops, try again.
Your code doesn't look quite right. Check the Hint if you need help!

Replace this line with your code. 

var varName = "userChoice"
var computerChoice = Math.random()
if (comuterChoice <= 0.34){
computerChoice ="rock";
else if (computerChoice <= 0.67) {
computerChoice ="paper";
else {
computerChoice ="scissors";


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

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


check your spelling here

if (comuterChoice <= 0.34) // computer

and close else statement

also read the instructions

If computerChoice is between 0 and 0.33, make computerChoice equal to "rock".


Oh, what a mistake! Thank you and good day.


I have stuck again in step 6. Kindly assist. This is my code:

var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie!";
else if(choice1==="rock") {
if(choice2 === "scissors") {
return "rock wins";
else {
return "paper wins";


and the url is:


you should create a new post so everyone can help you .you'll get faster answer :slight_smile:

however, close the function after closing else if statement.
just add }


I have created a new post. But by putting a } symbol its also not working. Where else could the problem be. Thanks.


you have to call the function.without calling it'll not work. post your updated code.

and check it how function works


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.