create an array till any particular number in reactjs : <p>I am a beginner in React js and trying to do some operations.</p>

<p>I want to create an array till the length of any array (particular number)
suppose my array length is 10 , then the array should be</p>

<p>my state variables-</p>

<pre><code> this.state{
 length = 10,
 length_array= []
}

handleClick = () =&gt;{
    this.setState{
    length_array:[1,2,3,4,5,6,7,8,9,10]
}}
</code></pre>

<p>I want to display this array in my table header</p>

<pre><code>&lt;Table&gt;
  &lt;tr&gt;
     &lt;th&gt;
         this.state.length_array.map((item, key) =&gt;
         &lt;th&gt;{item.name}&lt;/th&gt;
);
     &lt;/th&gt;
  &lt;/tr&gt;
&lt;/Table&gt;
</code></pre>

<p>Thanks.</p>
