19. How does if ("Jon".length * 2 / (2+1 ) === 2 get 2?


#1

How does if ("Jon".length * 2 / (2+1 ) === 2 get 2?
I mean i dont understand this either - "Jane".length + 5 evaluates to 9


19. I'm not seeing where im going wrong
#2

"Jon".length = 3.
Multiply 3 times 2 = 6.
(2+1) = 3.
6/3 = 2.

That is what is happening in that piece of code.


#3

Remember your order of operations:

1. "Parenthesis"
2. "Exponents"
3. "Multiplication" and "Division" left-to-right
4. "Addition" and "Subtraction" left-to-right

#4

so the default name number is 3?


#5

"Jon" is 3 letters long (hence length) J o n, 1 2 3 letters long. Jon.length = 3