xia@lemmy.sdf.org to Programmer Humor@programming.devEnglish · il y a 1 an"Works for me"lemmy.sdf.orgexternal-linkmessage-square84linkfedilinkarrow-up11.51Karrow-down115
arrow-up11.5Karrow-down1external-link"Works for me"lemmy.sdf.orgxia@lemmy.sdf.org to Programmer Humor@programming.devEnglish · il y a 1 anmessage-square84linkfedilink
minus-squareivnlinkfedilinkEnglisharrow-up5·il y a 1 anI’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·il y a 1 ani just added the === true for clarity
I’ve never seen the
!0and!1, it is dumb and indicates either young or terrible devs.Boolean(window.chrome)is the best,!!window.chromeis good, no need to test if it’s equal totrueif you make it a boolean beforehand.i just added the
=== truefor clarity