Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 14 days agoJavaScriptsh.itjust.worksimagemessage-square48fedilinkarrow-up17arrow-down11
arrow-up16arrow-down1imageJavaScriptsh.itjust.worksSjmarf@sh.itjust.works to Programmer Humor@programming.dev · 14 days agomessage-square48fedilink
minus-squareflying_sheep@lemmy.mllinkfedilinkarrow-up2·13 days 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())