title: How to perform the operation on the specific index selected in the array in javascript react?
body: <p>I have one array of objects and I want to show on specific index the field that I want that is a text box inside row of a table.</p>
  <p>Example of array of object as shown below:</p>
  <pre><code>const [showComment, setShowComment] = useState(false);
  
  const data = [
      {
        &quot;owner&quot;: &quot;Joe Alex&quot;,
        &quot;createddate&quot;: &quot;21/04/2022&quot;,
        &quot;comment&quot;: &quot;None&quot;,
        &quot;lastmodifieddate&quot;: &quot;png&quot;
      },
      {
        &quot;owner&quot;: &quot;John Doe&quot;,
        &quot;createddate&quot;: &quot;21/04/2022&quot;,
        &quot;comment&quot;: &quot;02/04/2020&quot;,
        &quot;lastmodifieddate&quot;: &quot;png&quot;
      },
      {
        &quot;owner&quot;: &quot;Rahul Sharma&quot;,
        &quot;createddate&quot;: &quot;21/04/2022&quot;,
        &quot;comment&quot;: &quot;Abc&quot;,
        &quot;lastmodifieddate&quot;: &quot;png&quot;
      }
    ]
  
  
  {data.map((value, id, abc) =&gt; {
   {showComment ?
                          &lt;input type=&quot;text&quot; name=&quot;&quot; id=&quot;&quot; placeholder=&quot;Enter comment&quot; /&gt;
                          :
                          &lt;div&gt;{value.comment}&lt;/div&gt;
                        }
    &lt;div&gt;&lt;Icon/&gt;&lt;/div&gt;
     
  }))
  </code></pre>
  <p>What I want is on the click of the icon by the help of the array index I want to show the the input textbox on the specific index selected. How can I do that?</p>