1 | initial version |
The comparison operator "<" has a higher precedence than the equality operator "===", which means that "1<3" will be evaluated first, resulting in the boolean value true. Then the comparison "1===true" is evaluated, which will return false because they are not equal in type or value.
To check if 1 is equal to 1 less than 3, you can use parentheses to group the comparison "1<3" and then compare it to 1 using the equality operator as follows:
(1 === (1 < 3))
This will return true because (1<3) will be evaluated to true, and then the comparison "1===true" is not made.