title: How to initialize a boolean array in javascript
body: <p>I am learning javascript and I want to initialize a boolean array in javascript.</p>
  
  <p>I tried doing this:</p>
  
  <pre><code> var anyBoxesChecked = [];
   var numeroPerguntas = 5;     
   for(int i=0;i&lt;numeroPerguntas;i++)
   {
      anyBoxesChecked.push(false);
   }
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>After googling I only found <a href="http://answers.unity3d.com/questions/330151/initialize-boolean-array-as-all-true-unity-js.html" rel="noreferrer">this</a> way:</p>
  
  <pre><code> public var terroristShooting : boolean[] = BooleanArrayTrue(10);
   function BooleanArrayTrue (size : int) : boolean[] {
       var boolArray = new boolean[size];
       for (var b in boolArray) b = true;
       return boolArray;
   }
  </code></pre>
  
  <p>But I find this a very difficult way just to initialize an array. Any one knows another way to do that?</p>