☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 7 months agoThe Divine Trinity of JavaScriptlemmy.mlimagemessage-square7fedilinkarrow-up1181arrow-down17
arrow-up1174arrow-down1imageThe Divine Trinity of JavaScriptlemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 7 months agomessage-square7fedilink
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up13arrow-down3·7 months ago== Well there’s your problem, you’re using an operator that shouldn’t exist. Triple equals all the things and if you want to coerce types write it out explicitly.
minus-squaremogoh@lemmy.mllinkfedilinkarrow-up16·7 months agoWhile you are basically right, the problem is that there is an operator that should not exist. Though that is not the biggest problem of JavaScript.
minus-squaredeadbeef79000@lemmy.nzlinkfedilinkarrow-up3·7 months agoSurprise Type coercion is our greatest weapon! What about the limitless coffers of Rome implicit global scope? Well then, surprise type coercion and the limitless coffers of Rome implicit global scope are our greatest weapons.
minus-squareJustas🇱🇹@sh.itjust.workslinkfedilinkarrow-up2·7 months ago["a"] + ["b"] = "ab" Goodnight, everyone.
Well there’s your problem, you’re using an operator that shouldn’t exist. Triple equals all the things and if you want to coerce types write it out explicitly.
While you are basically right, the problem is that there is an operator that should not exist. Though that is not the biggest problem of JavaScript.
SurpriseType coercion is our greatest weapon!What about the
limitless coffers of Romeimplicit global scope?Well then,
surprisetype coercion andthe limitless coffers of Romeimplicit global scope are our greatest weapons.["a"] + ["b"] = "ab"
Goodnight, everyone.