title: JavaScript set boolean by separate conditions?
body: <p>I need to design a global boolean with 2 conditions a and b such that if A is ever true, the boolean is true until b is true, at which point the boolean is false. In other words, if A becomes false the boolean remains true.</p>
  
  <p>I tried a straightforward global variable but it became false when A became false.</p>
  
  <p>Preferably JavaScript, but pseudocode would be almost as helpful.</p>