Here
is the interesting part, why do you think it is returning true
Below
in that picture, in if statement inside a parathesis the Javascript
automatically converts any value into Boolean:
1.Case
2.Case
The Switch Statement
So when you have many condition to check instead of using if/else
statement you
can simply use switch statement.
In this picture, as you can see it is checking whether it is true or false.
So the break is stopping the exacution of the code.
If none of them is true then
Expression is the pice of the code that produces the value.
In this picture the whole const
variable is the statement, the string ("23 is bigger
here") is the expression.
Ternary Operator
It is the easier version of using if/else statement like for making quick decisions.