It works the other way around as well
Take my angry upvote!
I had to check if that’s actually true. And yep, this is real.
It’s clearly is integer.
Real would be 10.0.
deleted by creator
NaN is actually a number in JavaScript
tbf its the floating point standards fault
My favorite data type, ‘number’
As someone who only had very peripheral contact with JavaScript I can’t tell if this is real and that is really the beauty (/s) of this language
It also works for booleans: If you want variable x to become boolean just negate it twice: !!b
I never learned JavaScript and I can very happily say, I won’t need it for my career. Hopefully.
No one escapes JavaScript. Your time will come
Ahhh… javascript…
I’m going to be honest, this probably makes sense more than any other JavaScript operator quirk I’ve seen.
Alternatively…
+"10" === 10
gross gross gross gross gross