/bit-switch

Primary LanguageJavaScript

Bit Switch Build Status

A helper class to store on/off states in one integer.

usage

const bitSwitch = new BitSwitch(32);
console.log('5', bitSwitch.get(5));	//	true
console.log('3', bitSwitch.get(3));	//	false


bitSwitch.set(4, 1);
console.log('4', bitSwitch.get(4));	//	true
bitSwitch.set(4, 0);
console.log('4', bitSwitch.get(4));	//	false