3 ms·
Which language uses !== instead of != ?
by SandB0x 17y ago
Which language uses !== instead of != ?
- carbocation 17y agoPHP. The !== checks for equality and for type. For example, it is true in PHP that 0 == false, but it is also true that 0 !== false.
- jcl 17y agoAlso Javascript: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Comparison_Operators https://developer.mozilla.org/en/Core_JavaScript_1.5_Referen...
- shawndumas 17y agoCorrect.
- ericd 17y agoBut given that now and then are both of type Temporal, he should still go for !=.
- deleted 17y ago[deleted]
- shawndumas 17y agoIt's strict not equal in JavaScript. 'Returns true if the operands are not equal and/or not of the same type.' . '==' and '!=' are coercive in JavaScript -- as in: 5 == "5" -> true 5 != "5" -> false 5 === "5" -> false 5 !== "5" -> true