Hey guys im stuck on 19 Javascript


#1

Hey guys this is the code(which is not edited)
("Jon".length * 2 / (2+1) === )
{
console.log("The answer makes sense!");
}
else
Here are the instructions.

Complete the missing bits of code to construct the if / else statement. Make the condition evaluate to true.
Finish the else statement by printing out the string "Error Error Error" to the console.
I dont understand how you do this. Someone help please


#2

I would suggest to you that the very first thing to look at is the proper format for an if/else statement.

In case you need a reminder, here is how you put one together:

    if (this is true) {
        do this thing;
    } else {
        do this other thing;
    }

#5

("Jon".length *2 / (2+1) === 2 );
{
console.log("The answer makes sense!");
}
else {
console.log("Error Error Error");
}

// this is what i wrote and it worked


#6

The code checker must have been snoozing if it let you by with that code. :slightly_smiling:


#7

sorry what i wrote before was wrong.
the actual code is
if("Jon".length *2 / (2+1) === 2 )
{
console.log ("the answer makes sense!");
}
else {
console.log("Error Error Error")
}


#8

That's better!

We don't normally post complete answers for the exercises here though. Its a bit like cheating.

You can help people learn without just handing out answers. Nudge them in the right direction, give them examples, explain how JavaScript works.

:green_heart:


#9

Turns Codecademy into SoloLearn :wink: