title: How to toggle many values at once / values are in a list?
body: <p>Is there an efficient way to toggle the Boolean value of multiple variables at once? My variables are lines that I want to show/hide depending on userValue.</p>
  
  <pre><code>myList = [lineA, lineB, lineC, lineD]
  </code></pre>
  
  <p>My example below is very hard-coded. There is a lot of repeated code. Is there a smarter way to do this?</p>
  
  <pre><code>if (userValue == 'A') {
      lineA.visible = true;
      lineB.visible = false;
      lineC.visible = false;
      lineD.visible = false;
  } else if (userValue == 'B') {
      lineA.visible = false;
      lineB.visible = true;
      lineC.visible = false;
      lineD.visible = false;
  } else if (userValue == 'C') {
      lineA.visible = false;
      lineB.visible = false;
      lineC.visible = true;
      lineD.visible = false;
  } else if (userValue == 'D') {
      lineA.visible = false;
      lineB.visible = false;
      lineC.visible = false;
      lineD.visible = true;
  }
  </code></pre>