DEV Community

loading...

Discussion on: 17 Pro JavaScript tricks you didn't know

Collapse
aralroca profile image
Aral Roca

And it's not correct for decimal numbers.

Boolean(122^123) // true
Boolean(123.1^123) // false -> is not correct, should be true 123.1 !== 123
Boolean(123^123) // false
Enter fullscreen mode Exit fullscreen mode

Much better to use the !== operator.