Bitwise operations

Any tips for general bit operations on a byte type?
Such as setting or clearing a specific bit in a byte?

// pseudo
let byte = '\0x00';
let bit = 4;
byte |= 1 << bit; // set bit
byte &= ~(1 << bit); // clear bit