title: Change a boolean back and forth in Javascript
body: <p>I wonder if it is possible in Javascript to have a <code>click</code> event listener that every time I click changes my boolean from true to false back and forth. Meaning I click one it goes to false, I click again and it goes to true and so on in an infinite loop. I don't even know if it is possible but I tried this:</p>
  <pre><code>//This is my listener
  circlePicker.click(function () {
      booleanChecker(circlePickerSelector);
      console.log(booleanChecker(circlePickerSelector));
  });
  
  //This function checks if the boolean is true or false
  function booleanChecker(isThisTrue) {
      // circlePickerSelector = !circlePickerSelector;
      // return circlePickerSelector;
      if (isThisTrue == false) {
          isThisTrue = true;
          console.log(&quot;I turned into true&quot;);
      } else if (isThisTrue == true) {
          isThisTrue = false;
          console.log(&quot;I turned into false&quot;);
      }
      return isThisTrue;
  }
  </code></pre>
  <p>I would like to know if this is possible. I get a feeling something is wrong in my syntax. Any suggestion is more than welcome.</p>