xia@lemmy.sdf.org to Programmer Humor@programming.devEnglish · 1 个月前"Works for me"lemmy.sdf.orgimagemessage-square85fedilinkarrow-up11.49Karrow-down114
arrow-up11.47Karrow-down1image"Works for me"lemmy.sdf.orgxia@lemmy.sdf.org to Programmer Humor@programming.devEnglish · 1 个月前message-square85fedilink
minus-squareivnlinkfedilinkEnglisharrow-up5·1 个月前I’ve never seen the !0 and !1, it is dumb and indicates either young or terrible devs. Boolean(window.chrome) is the best, !!window.chrome is good, no need to test if it’s equal to true if you make it a boolean beforehand.
minus-squareredirtSdeR@lemmy.worldlinkfedilinkEnglisharrow-up1·28 天前i just added the === true for clarity
I’ve never seen the
!0
and!1
, it is dumb and indicates either young or terrible devs.Boolean(window.chrome)
is the best,!!window.chrome
is good, no need to test if it’s equal totrue
if you make it a boolean beforehand.i just added the
=== true
for clarity