cm0002@lemmy.world to Programmer Humor@programming.dev · 12 days agoWhich of these javascript expressions is false?imagemessage-square79linkfedilinkarrow-up11arrow-down10cross-posted to: programmerhumor@lemmy.ml
arrow-up11arrow-down1imageWhich of these javascript expressions is false?cm0002@lemmy.world to Programmer Humor@programming.dev · 12 days agomessage-square79linkfedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squarejaark@infosec.publinkfedilinkEnglisharrow-up0·11 days 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!
minus-squarezarkanian@sh.itjust.workslinkfedilinkarrow-up0·11 days agoDouglas Crockford has a whole chapter of these in his latest book. There’s also this classic video.
minus-squareNat (she/they)@lemmy.blahaj.zonelinkfedilinkarrow-up0·11 days agoNumber = IEEE-754 double precision float, which includes NaN, so it makes sense
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!
Douglas Crockford has a whole chapter of these in his latest book. There’s also this classic video.
Number = IEEE-754 double precision float, which includes NaN, so it makes sense