title: Javascript - Bit Alarm Messages - get all possible combinations
body: <p>i had the problem that i had an alarm message which is in a byte</p>
  
  <p>example:
  1) 0000 0001 - is alarm 1
  2) 0000 0010 - is alarm 2
  3) 0000 1000 - is alarm 3
  4) 1000 0000 - is alarm 4</p>
  
  <p>so the problem is that if alarm 1 and alarm 4 is at the same time the byte looks like this: 1000 0001 and if it is alarm 1, 2 and 4 its: 1000 0011
  is it possible to get all possible combinations for the alarm with a javascript function?</p>
  
  <p>i know there are only 4 but this is only a example i had some with all 8 bits</p>
  
  <p>thank you in advance</p>