4 ms·
Just always use !==. != will automatically cast and !== won't, therefore "1" != 1 is false and "1" !== 1 is true.
by fzzzy 3y ago
Just always use !==. != will automatically cast and !== won't, therefore "1" != 1 is false and "1" !== 1 is true.
- hellcow 3y agoUnless you’re testing if something is null or undefined, in which case a single “x != null” handles it.
- deleted 3y ago[deleted]