It works for me. Note that `|` is a bitwise-or (not that it really matters, it just removes a branch)
const True = -1
const False = 0
const ternary = (condition, left, right) => \
(condition & left) | (~condition & right)
ternary(True, 0, 1) // 0
ternary(False, 0, 1) // 1