SyntaxError: Syntax error HELPPPPPPPPP


#1

Help me am stuck!!!!! if no one comes to rescue I will be stuck on here forever.

Am stuck on exercise 19 (Maths) this is the if and else statement, this is what I wrote but can't figure out my error

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

and the error that is showing is this

SyntaxError: Syntax error


Replace this line with your code.


#2

Fix the if
1. you typed f insted of if
2. you typed (...(2+1) ===)
but you didnt typed equal to what.


#3

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

the top one means 3 letters of (jon) x 2 which is 6 and divide that by 2+1 which is 3 , === are equal print etc etc


#4

this is what I have to do.

Complete the missing bits of code to construct the if / else statement. Make the condition evaluate to true.
02. Finish the else statement by printing out the string "Error Error Error" to the console.

and the code is this which I have to correct.

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

now how shall I get this correct and what was my mistakes before?

Thanks.


#5

to the right of equal statement there should also be some value.


#6

As @puristaja said, there should be a value after the equal statement.
in this case, the value is 2 so your code should say:

if("jon".length * 2 / (2+1) === 2)

#7

Now what's wrong with this.

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

console.log ("Error Error Error");

}

it says syntax error???Where?

Thanks


#8

i think the (2+1) is the problem


#9

Looks like something is missing before the condition on line 1


#11

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