title: Javascript bitwise reset value
body: <p>I have </p>
  
  <pre><code>bit1 =1
  bit2 =2
  bit3 =4 
  etc...
  </code></pre>
  
  <p>I want to store 0 or 1 (false o true) at bit2,
  so : </p>
  
  <pre><code>my_value=0;
  mydata |=bit2*myvalue;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>my_value=1;
  mydata |=bit2*myvalue;
  </code></pre>
  
  <p>(my_value colud be some checkbox state)</p>
  
  <p>My problem is that after having set mydata to 1 I cant set it to zero.
  Bitwise  1 |= 0 is 1 ....</p>
  
  <p>So I'd need a way to set a bit to zero. 
  Is there any way to make this using without tricks?</p>
  
  <p>The clear method force us to previously know the value ?
  Any help w. be appreciated.</p>