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 -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -