title: Extracting one value from array into a variable - ReactJS
body: <p>I know that maybe i will sound stupid for some people , but i am trying to extract single value from my array and insert it into a variable . How was possible to do it . In my case i want to have a new variable with the value only of the <code>fileId</code></p>
  
  <pre><code>const arrayOfFiles = rowData.files;
  </code></pre>
  
  <p><strong>Output :</strong> </p>
  
  <pre><code>[{…}, {…}]
  0: {fileId: 166, fileExtension: "CSV"}
  1: {fileId: 167, fileExtension: "XLSX"}
  lastIndex: (...)
  lastItem: (...)
  length: 2
  __proto__: Array(0)
  </code></pre>
  
  <p><strong>Tryout</strong></p>
  
  <pre><code> arrayOfFiles.forEach(file=&gt; console.log(file.fileId));
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>166
  167
  </code></pre>
  
  <p>But how can i insert this value into a single variable ? 
  I gave a try something like this : </p>
  
  <pre><code>const fileId = arrayOfFiles.forEach((file) =&gt; file.fileId);
  </code></pre>
  
  <p>But it returns me <code>undefined</code> . Any suggestions what am i doing wrong ? </p>