19. Math


#1

What did I missed?

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


#2

@j00,
What Oops- or Error- message are you getting ??


#3

Yes, I got that Error message; Oops, try again. There was a problem with your syntax.

And I got this, too; SyntaxError: Unexpected token }


#4

@j00,

What is the Result of 6 divided by 3 .....!!!!!!
Make the change
and then do a reset of your Browser

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#5

Current my screen->

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

I refresh my Browser. But there are not changes.

The reason i put "0" is that I want result of "else"


#6

@j00,
You will have to comply with the Instructions !!!!!!!!
And 6 / 3 = 2


#7

It's mistake. I changed "3" to "2"
And I got right result.

I'm So sorry to bother you and Thank you so much.


#8

@j00,

nice to know

You could test in labs.codecademy.com
choose Javascript
You will get a split-screen
In the left-hand-side you paste-in your code
click on the Run button.
The right-hand-side is the console

references

www.crockford.com --> for most respected guide-line in Javascript
like coding convention
www.crockford.com
http://javascript.crockford.com/code.html <== Javascript code-convention
http://javascript.crockford.com/survey.html


#9

Hi this part

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

The length of Jon is equale to 3

"Jon".length === 3

Then you moltiply it by 2 and the result its 6

"Jon".length * 2 === 6

The you divide it by 3 and its result 2

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

This is how your code should be .


#10

Thank you, this post was helpful.


#12

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

this is the correct code.


#13

my code is currently:
if ("Jon".length * 2 / (2 + 1) === 2 )
{
console.log("true");
}
else
{
console.log("Error Error Error");
}

When i run it returns "true"
When i run this it results in the error "Oops, try again. Make sure your if/else statement evaluates to true"


#14

i still could not get it to work I have typed everything that is shown on my first try and still looked it over with yours and its saying that I have a syntax error


#15

Please create your own topic with code + lesson and error
Thank You