DEV Community


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

aralroca profile image
Aral Roca • Edited

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.

Forem Open with the Forem app