title: How to negate bool inside function in JS?
body: <p>I'm writing some script now and I have a problem when trying to negate boolean inside a function. I mean this:</p>
  
  <pre><code>var test = true;
  
  function changeThisBoolPlease(asd){
    asd=!asd;
  }
  
  alert(test);
    changeThisBoolPlease(test);
  alert(test);
  </code></pre>
  
  <p>alerts true, then true.</p>
  
  <p>Any ideas? Isn't JS reference perfect?</p>
  
  <p>EDIT:</p>
  
  <p>Ok, this was only a part of my function:</p>
  
  <pre><code>function przesun(kolor, figury, castlings, x1, y1, x2, y2, strona) {
      kolor = nowaPozycjaKolor(kolor,x1, y1, x2, y2);
      figury = nowaPozycjaFigur(figury,x1, y1, x2, y2);
      strona = !strona;
  }
  </code></pre>
  
  <p>Actually I cannot return this value. How to?</p>