Preact - Next.js - Deno - SSR - SSG 💻
Open source 📂
Machine learning 🤖
Books 📖
Sport 🏃♂️
Nature 🌱
Focus on being useful. I contribute AMAP to the OSS community. Love learning by doing.
Yeah, the XOR operator isn't doing an equivalence check, at least not in the way the OP is presenting. It's just not a relevant tool to use, I don't think.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't believe this code actually improves anything, like many other snippets presented here. It sacrifices one keyboard hit for legibility.
While I might be dumb for not knowing the trick, the difficulty is to make the code better understandable, not vice versa.
And doesn't work as expected....
Boolean(123.1^123) // false, but should be true
Yeah, the XOR operator isn't doing an equivalence check, at least not in the way the OP is presenting. It's just not a relevant tool to use, I don't think.