Skip to content
Akin C edited this page May 7, 2017 · 12 revisions

Welcome to the Javascript-comparison-equal-operators- wiki!

Javascript allows to use a clutch of different comparisons with the equal operator, but the focus in this project lies in the following operators:

Nr. Operator Description Example
1 "==" equal to
"1.0e0" == true//is true
2 "===" equal value & type
"1.0e0" === true//is false

Example 1 is true, because operator 1 converts the string and the boolean type into type number and than compares them.

Just for clarification: 1.0e0 = 1.0 * 100 = 1.0 * 1.0 = 1.0

Even though both values in Example 2 are the same in meaning, they are different in type and that is why the result is false.

Using operator 1 with mixed types should be avoided, because of clearer purpose of the code.

STILL IN WORK!

Clone this wiki locally