4 ms·
You can do literal comparison using === But the problem in my perception is that it is very error-prone. A less error-prone solution would be only convert one
by caioariede 15y ago
You can do literal comparison using ===
But the problem in my perception is that it is very error-prone. A less error-prone solution would be only convert one string value to number when the another is really a number. For example:
'9223372036854775807' == 9223372036854775808
- mistercow 15y ago> A less error-prone solution would be only convert one string value to number when the another is really a number. That is, in fact, exactly how JS handles it.