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