function one_bit(x) { return x & (x-1) == 0 }
Expected "}" or comment but "&" found.
function one_bit(x) { return x & (x-1) == 0 ? 1 : 0; }