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
Javascript has a ternary operator you could use:
var i = result ? 1 : 0;