Numbers

William Standley


add

12 + "34" = 1234

toString

12

Exponent

3.14159e+0

Fixed

3.142

Precision

3.14

Float

-20.5656
20

Int

-20
20

Equals

The === operator is a very strict operator in the fact that everything has to be identical on the comparison in order for it to return the statement as true. In other words a 1:1 comparison for each character. The == operator is much less strict as the two things being compared just have to be technically the same. For example, in the LinkdIn Learning, they use the word 'one' and the number '1' as a string. Technically they are the same as both are one, however the characters are not a 1:1 ratio, so using the === operator would return it as false since the character set does not match.

Logic

When it comes to the order of precedence for and / or operators, the and operator always gets checked first no matter what order you type them in. The only time the and operator isn't checked first is if you put parenthesis around an or statement in which it would run whatever is in the parenthesis first and at that point is when it would check the and statement once whatever was done in the parenthesis is executed.

Switch

Why didn't you type 'TEST'.

Ternary

I just used a ternary operator