title: How to use .map() function on JSONArray in reactjs ES6
body: <p>I have a JSONArray returned by the server. I want to use .map() on it so that i can get key,values pairs of every object present in that array. I have written following code but i am getting error "files.map is not a function". Can anyone please help me resolve this?  </p>
  
  <pre><code>showUploadedFiles()
    {
      const page = 1;
      const items_per_page = this.state.event.file_ids.length;
      getAllTaskFiles(this.state.event.id, page, items_per_page).then((allFiles) =&gt; {
        this.renderUploadedFiles(allFiles);
      });
  
    }
  
    renderUploadedFiles(files)
    {
      let details = null;
      details = files.map((singleFile) =&gt; {
      return (
        &lt;div&gt;
          &lt;a href="#" &gt;{singleFile.filename}&lt;/a&gt; 
          &lt;a href="#" &gt;{singleFile.file_path}&lt;/a&gt;
        &lt;/div&gt;
        );
      });
    }  
  </code></pre>
  
  <p>My JSONArray is:  </p>
  
  <pre><code>[{"file_id": 5224879255191552, "filename": "children_walk_friends_forest_116878_3840x2160.jpg", "file_path": "/api/files/encoded_gs_file%3AdHJhY2tpbmctYXBpL3YxL2FjY291bnRzLzU2Mjk0OTk1MzQyMTMxMjAvdGFza3MvNDk5NjE4MDgzNjYxNDE0NC81MjI0ODc5MjU1MTkxNTUyL2Zha2UtemRNeklhZ1RTYl9PN3RXY2pXbkhVQT09"}, {"file_id": 4943404278480896, "filename": "banner_old.jpg", "file_path": "/api/files/encoded_gs_file%3AdHJhY2tpbmctYXBpL3YxL2FjY291bnRzLzU2Mjk0OTk1MzQyMTMxMjAvdGFza3MvNDk5NjE4MDgzNjYxNDE0NC80OTQzNDA0Mjc4NDgwODk2L2Zha2UtcmJjbDBVdVFzVmZkMjRtRUV2ME1xZz09"}] 
  </code></pre>