1Javascript Bitwise Operators
2& AND statement
3| OR statement
4~ NOT
5^ XOR
6<< Left shift
7>> Right shift
8>>> Zero fill right shift
9
1var myEnum = {
2 left: 1,
3 right: 2,
4 top: 4,
5 bottom: 8
6}
7
8var myConfig = myEnum.left | myEnum.right;
9
10if (myConfig & myEnum.right) {
11 // right flag is set
12}