☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 7 months agoThe Divine Trinity of JavaScriptlemmy.mlimagemessage-square3fedilinkarrow-up13arrow-down10
arrow-up13arrow-down1imageThe Divine Trinity of JavaScriptlemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 7 months agomessage-square3fedilink
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up0·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-squareJustas🇱🇹@sh.itjust.workslinkfedilinkarrow-up1·7 months ago["a"] + ["b"] = "ab" Goodnight, everyone.
minus-squaremogoh@lemmy.mllinkfedilinkarrow-up1·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.
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.
["a"] + ["b"] = "ab"
Goodnight, everyone.
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.