JPDev@programming.dev to Programmer Humor@programming.dev · 9 个月前===programming.devimagemessage-square64fedilinkarrow-up1504arrow-down114
arrow-up1490arrow-down1image===programming.devJPDev@programming.dev to Programmer Humor@programming.dev · 9 个月前message-square64fedilink
minus-squareBougieBirdie@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up6·9 个月前The other comments explains it in pretty good detail, but when I was learning my teacher explained it sort of like a mnemonic. 1 + 1 = 2 is read “one plus one equals two” 1 + 1 == 2 is read “one plus one is equal to two” 1 + 1 === 2 is read “one plus one is really equal to two” And you hit the nail on the head, is that === is type explicit while == is implicit.
minus-squarebobbykjack@programming.devlinkfedilinkarrow-up2·edit-29 个月前I’d use something like: = becomes == equals === is identical to It’s funny how everyone thinks “equals” in this context should be “identical to” when, in normal language, it doesn’t really mean that at all!
The other comments explains it in pretty good detail, but when I was learning my teacher explained it sort of like a mnemonic.
1 + 1 = 2 is read “one plus one equals two”
1 + 1 == 2 is read “one plus one is equal to two”
1 + 1 === 2 is read “one plus one is really equal to two”
And you hit the nail on the head, is that === is type explicit while == is implicit.
I’d use something like:
= becomes
== equals
=== is identical to
It’s funny how everyone thinks “equals” in this context should be “identical to” when, in normal language, it doesn’t really mean that at all!