19. Maths HEEEELP


#1

Hello everyone! I am new in code academy and I am just starting to code.
I am totally lost, I really appreciate some help!

if("Ana".length * 2 / (2+1) === ) {
console.log("¡Esa respuesta tiene sentido!")}
else ("Ana".length + 3 / (4+2) ===)
{
console.log("Error Error Error");
}

I get :SyntaxError: Unexpected token ) where is the error in the syntax? THANKS I GOT THE EXERCISE! :smile:


#2

Ok first of all something about conditions in general. The idea of conditional statements is to make the execution of code optional and thereby make the control flow of the program a little more interactive then just:

statement;
statement;
statement;

a the code in this statement:

if(condition){
    code
}

is only executed if condition is true otherwise you just go on after the }. So as the task here is afaik to print:

console.log("¡Esa respuesta tiene sentido!")}

(don't know the spanish course maybe check the instructions if the message is correct). So you need to make sure that the condition is true:

"Ana".length * 2 / (2+1) === X

which means that you need to find a value for X that is the same as the value on the other side of the === (compares value and type). I guess you can do the math and if not
console.log("Ana".length * 2 / (2+1)) might be handy.

And the other thing is the else. else just means that this should be run when the condition was false, as this already is a condition there doesn't need to be another one so else always goes without condition:

else
  {
    console.log("Error Error Error");
  }

#3

Thank u so much hexor789!