JPDev@programming.dev to Programmer Humor@programming.dev · 7 months ago===programming.devimagemessage-square70fedilinkarrow-up1677arrow-down117
arrow-up1660arrow-down1image===programming.devJPDev@programming.dev to Programmer Humor@programming.dev · 7 months agomessage-square70fedilink
minus-squareSzethFriendOfNimi@lemmy.worldlinkfedilinkarrow-up129·edit-27 months agoSo in JavaScript there’s the assignment = and the comparator is == Since there’s no types JS will do implicit conversion before comparison when using == in a case like this if(false == '0'){ //this is true } But with === it doesn’t. It means literally compare these if(false === '0'){ //this is false }else{ //so this will execute instead } But this, however, will var someState = false; if(someState === false){ //this is true }
So in JavaScript there’s the assignment
and the comparator is
Since there’s no types JS will do implicit conversion before comparison when using == in a case like this
But with === it doesn’t. It means literally compare these
But this, however, will
deleted by creator
Np. closed as duplicate