cm0002@lemmy.world to Programmer Humor@programming.dev · 1 day agoWhich of these javascript expressions is false?imagemessage-square53linkfedilinkarrow-up1337arrow-down12cross-posted to: programmerhumor@lemmy.ml
arrow-up1335arrow-down1imageWhich of these javascript expressions is false?cm0002@lemmy.world to Programmer Humor@programming.dev · 1 day agomessage-square53linkfedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squarejaark@infosec.publinkfedilinkEnglisharrow-up4·edit-214 hours agoI don’t think my sanity can take all of these explanations. Though I just spotted one that’s worse than null being an object … typeof NaN "number" I mean, come on… it’s even in the fucking name! Edit - fixed capitalisation in ‘NaN’
minus-squareNat (she/they)@lemmy.blahaj.zonelinkfedilinkarrow-up3·10 hours agoNumber = IEEE-754 double precision float, which includes NaN, so it makes sense
minus-squarezarkanian@sh.itjust.workslinkfedilinkarrow-up3·13 hours agoDouglas Crockford has a whole chapter of these in his latest book. There’s also this classic video.
I don’t think my sanity can take all of these explanations.
Though I just spotted one that’s worse than null being an object …
typeof NaN "number"
I mean, come on… it’s even in the fucking name!
Edit - fixed capitalisation in ‘NaN’
Number = IEEE-754 double precision float, which includes NaN, so it makes sense
Douglas Crockford has a whole chapter of these in his latest book. There’s also this classic video.