"Works for me"
"Works for me"
I’m going to have to go down the rabbit hole of making my own website soon. Just curious but would there be an easy way to show a pop up just to people using chrome?
No reason in particular… 😏
!!window.chrome === true
window.chrome is defined and done non-empty value, double negation turns it into just true.
window.chrome == true or Boolean(window.chrome), but it turns out that the former doesn’t work and that == has essentially no use unless you remember some completely arbitrary rules, and that JS developers would complain that the latter is too long given the fact that I’ve seen javascript code using !0 for true and !1 for false, instead of just true and false because they can save 2 to 3 characters that way.
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.
=== true for clarity