cm0002@lemmy.world to Programmer Humor@programming.dev · 1 年前Which of these javascript expressions is false?lemmy.mlexternal-linkmessage-square79linkfedilinkarrow-up1512arrow-down111
arrow-up1501arrow-down1external-linkWhich of these javascript expressions is false?lemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 1 年前message-square79linkfedilink
minus-squareskisnow@lemmy.calinkfedilinkEnglisharrow-up24·1 年前That one wasn’t the one I had issues with, since the concept is essentially the same across all languages. We say it’s false because we can’t conclusively say that it’s true. Same as the reason why null != null in SQL.
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up5·1 年前It also makes a lot of conditional expressions less complicated because comparisons of all kind against NaN return false.
That one wasn’t the one I had issues with, since the concept is essentially the same across all languages. We say it’s false because we can’t conclusively say that it’s true. Same as the reason why null != null in SQL.
It also makes a lot of conditional expressions less complicated because comparisons of all kind against NaN return false.