☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year agoThe Divine Trinity of JavaScriptlemmy.mlimagemessage-square4fedilinkarrow-up18arrow-down11
arrow-up17arrow-down1imageThe Divine Trinity of JavaScriptlemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year agomessage-square4fedilink
minus-squarexmunk@sh.itjust.workslinkfedilinkarrow-up0·1 year 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·1 year ago["a"] + ["b"] = "ab" Goodnight, everyone.
minus-squaremogoh@lemmy.mllinkfedilinkarrow-up1·1 year 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.