title: Reactjs state initialize an array of values
body: <p>I am trying to initialize an array of boolean values, where there is a different value on a specific position in array.</p>
  
  <p>If I initialize state like this, empty is array.</p>
  
  <pre><code>state = {
      activeItems: [...new Array(5)].map((item, idx) =&gt;
        idx === 1 ? true : false
      )
  }
  </code></pre>