export enum VALUES {
VALUE1 = 0x0001,
VALUE2 = 0x0002,
VALUE3 = 0x0004,
VALUE4 = 0x0008,
VALUE5 = 0x0010,
VALUE6 = 0x0020,
VALUE7 = 0x0040,
VALUE8 = 0x0080,
VALUE9 = 0x0100
}
In JS it's easy to know if a mask contains a value with the & operator:
(mask & VALUES.VALUE1) === VALUES.VALUE1
But how can i compare two masks and know which are the differences or how many differences there is ?