boolean to 1 or 0 javascript code example Example: javascript cast bool to int + true; // 1 + false; // 0