Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year agoJavaScriptsh.itjust.worksimagemessage-square48linkfedilinkarrow-up15arrow-down11
arrow-up14arrow-down1imageJavaScriptsh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year agomessage-square48linkfedilink
minus-squareflying_sheep@lemmy.mllinkfedilinkarrow-up2·1 year agoJust use a formatter. It’ll show you that the second one is two statements: {} (the empty block) +[] coerce an empty array to a number: new Number(new Array())
Just use a formatter. It’ll show you that the second one is two statements:
{}
(the empty block)+[]
coerce an empty array to a number:new Number(new Array())