Stuck on level 19.Math


#1

could someone take a screenshot of their finished script for part 19.Math, I checked the hint and fixed what they asked me to and it still won't let me through to the next section. Thanks :confused:


#2

I can post the code I've used, but it is more usefull for you to post your code so we can see what went wrong. Maybe you can do that first and we can give you hints or the final code.


#3

Do:
• Give hints, tips and tricks.

Don't:
• Give the correct code with no explanation because you can't be bothered.
• Post pictures of code as opposed to text, it's annoying.


#5

I think it may be a ;(semi colon) on you first line.
Saying that I've only just done that bit myself so I'm not 100%


#6

Simple problem, just look at your first line, the the number/variable after the three equal signs.
And do not forget the if and else statement and their conditions.


#8

Please help


#9

I need help with this one....

It seems as though every answer that I put in is wrong:

confirm("Jon".length * 2/(2+1) === 2);
if
{
console.log("The answer is not 3!");
}

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

Can I please get some help????


#10

confirm("Jon".length * 2/(2+1) === 2); //No semi-colon at end of if statements
if //If statement should be "if(condition) { ... }" as posted below.

That should actually look like this:

if ("Jon".length * 2/(2+1) === 2) {
   //Code here!
}

#11

thank you @lolman, however, the statement is still not evaluating to true...

HELP.....

if("Jon".length * 2/(2+1) === 2)
{
console.log("The answer is equal to 3!");
}
else
{
console.log("Error Error Error");
}


#12

There's nothing wrong with your code. Try refreshing your page and seeing if that fixes your error.


#13

Apparently there is something wrong with it. I refreshed the page, and it still says there's something wrong with the syntax...


#14

Honestly, there is nothing wrong with your code in terms of syntax. I'd suggest you check the console.log statement and make sure it matches the instructions exactly.


#15

You were right, I reset the code and typed it in this way, and then I passed the exercise:

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

Thanks, @lolman


#16

I refreshed and removed the semicolon in error error error and that seemed to work for me


#17

A post was split to a new topic: Sa ne marche toujours pas


#18