How do i make a if statement inside an if statement (Lesson 6)


I have tried typing different codes but it still won't work


You just have to wrap two functions up. This is the normal syntax:

var something = 3;
if(something == 3){
    console.log("Double If Statement Completed!")

If you are still facing problem, show code please.


I understand now but there is a syntax error:frowning:
Syntax error illegal return statement.

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


Many mistakes there... but ima give you hints.

1: An Else statement is not suppose to have conditions...
2:Some Code for some reason are out of the function
3: To Solve your problem, As you merge everything in that function you will be faced with an else if.. then you can nest an if/else statement under that.


Thanks, i appreciate your time and effort for helping me.