Besides :
true ? 1 : 0
is there any short trick which can \"translate\" True->1 and False->0 in Javascript ?>
True->1
False->0
You can use ~~boolean, where boolean is (obviously) a boolean.
~~boolean
boolean
~~true // 1 ~~false // 0