19.math


#1

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

What am i doing wrong?


#2

Problem is in this line:

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

Let's read it. If length of string "Jon" multiplied by 2 and divided by 2 + 1 is equal... That's the problem.

If you use a equality check operator (===) you have to specify left operand and right operand. Example:

2 * 9 === 17
// >> false
15 * 15 === 225
// >> true

#3

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

it still doesnt pass..so confused.


#4

@factoradic is saying that there are two sides to a comparison statement and yours is missing something.

there should be a value, where I put the X


#5

i dont get it can you explain a little bit more


#6

Can you post me the current code you have?


#7

Lets analyze and Evaluate the Given codes.

"Jon".length * 2 / (2+1) === ????

1. Jon.length: meaning it will count the letters on the word Jon. It is 3 letters. ( 3 * 2 / (2+1) === ??? )
2.) So number of letters which is 3 * 2 = 6. ( 6 / (2+1) === ??? )
3.) 2 + 1 =3 . ( 6 / 3 === ??? )
4.) 6 / 3 = 2 ( 2 === 2 )
the result is

( "Jon".length * 2 / (2+1) === 2) //true

Hope this helps


#8

this is easy guys you got this


#10

no you put in the actual answer which is 2 because otherwise you have invalid syntax


#11

its simple guys just do the math,
the length of Jon (3) times 2 (6) divided by 3 = 2
2 is what is after the === which is the symbols for when something is correct then == for when its not correct, lomu87 you forgot to write the else statement for if jon didnt equal 2, and having the variable x wouldnt work because its invalid syntax its not what its asking for


#12

@grantbachmura
I believe the aim of this forum is not to post answers, but to guide advice seekers back to the right path. So that they can learn from their mistake and not just copy/paste the answer.

That is why I said:

I acknowledge my mistake, I will strive to give better explanations.

Something simple is always not easy. We humans don't run off an assembly line, we are unique with our strengths and weaknesses, what is easy to me and you, may take someone else a bit longer to learn. And vice versa they may posses a skill that you and I would struggle to learn. I would be put off very quickly if somebody told me: it is simple why don't you understand.


#13

thanks for the input everbody....really appreciated


#15

just put 2 after === it's done.

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


#16