@[email protected] to Programmer [email protected] • 1 year agoYup, Javascript can go F@#! itselflemmy.mlimagemessage-square28fedilinkarrow-up156arrow-down14
arrow-up152arrow-down1imageYup, Javascript can go F@#! itselflemmy.ml@[email protected] to Programmer [email protected] • 1 year agomessage-square28fedilink
minus-squareBjörn Tantaulinkfedilink0•1 year agoCan someone explain this? I mean, the last result. Usually I can at least understand Javascript’s or PHP’s quirks. But this time I’m stumped.
minus-squaremycuslinkfedilink2•edit-21 year agoJS null and undefined shenanigans basically: bigger an lesser comparison types convert null to zero, so is zero bigger than zero? no == is fucky and to it null only equals undefined and undefined only equals null, so no is zero bigger than or equal to zero? yeah
minus-squaremycuslinkfedilink0•1 year agoI’m starting to think JS maintainers have a thing against mathematicians
minus-squareomnislayer88linkfedilink1•1 year agoMy only thought here might be >= is usually the same as !< and maybe thats how it is defined in javascript and since < is false than >= == !false == true
Can someone explain this? I mean, the last result. Usually I can at least understand Javascript’s or PHP’s quirks. But this time I’m stumped.
JS null and undefined shenanigans
basically:
==
is fucky and to it null only equals undefined and undefined only equals null, so noUgh, thanks, of course. Stupid brain.
I’m starting to think JS maintainers have a thing against mathematicians
more likely against humans
My only thought here might be >= is usually the same as !< and maybe thats how it is defined in javascript and since < is false than >= == !false == true