I have a variable that stores false or true, but I need 0 or 1 instead, respectively. How can I do this?
false
true
0
1
+!! allows you to apply this on a variable even when it's undefined:
+!!
undefined
+!!undefined // 0 +!!false // 0 +!!true // 1 +!!() // 1 if it evaluates to true, 0 otherwise