I know that the ===
operator is used to determine whether its both operands are equal and identical or not. That is to say that if left side operand has 1 then the right side operand must be 1 for returning true
. but I don't get why javascript returns true for this calculation.
true || 1 === 1/3;
//true;
I don't get how this result can be true in JavaScript.
The ===
Operation will never be checked. The statement is true by true
.
Also see this question and answer on how if statements are evaluated.