title: Object is not extensible error when creating new attribute for array of objects
body: <p>I have a function that needs to extend a javascript array, including a new attribute called <code>selected</code>:</p>
  
  <pre><code>export const initSelect = (data) =&gt; {
  
      let newData = data.concat();
      newData.map((item) =&gt; {
          item.selected = false;
      })
  
      return newData;
  }
  </code></pre>
  
  <p><code>data</code> is a ReactJS state value (comes from <code>this.state.data</code> when calling the function), but this didn't seem to be a problem as <code>newData</code> is a new copy of <code>data</code> array...</p>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>TypeError: Cannot add property selected, object is not extensible
  </code></pre>