JavaScript set boolean by separate conditions? -


i need design global boolean 2 conditions , b such if ever true, boolean true until b true, @ point boolean false. in other words, if becomes false boolean remains true.

i tried straightforward global variable became false when became false.

preferably javascript, pseudocode helpful.

this sounds xor. i.e.

!a , !b == false , !b == true !a , b == true , b == false 

unfortunately, javascript doesn't have logical xor operator, however

if( ? !b : b ) {

is functionally equivalent


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -