title: React's Promise: How to convert array into json
body: <p>I have a list of pages obtained from an API that I stored in an array. I want to convert the array into JSON data so I can access the objects and store them in a state variable. </p>
  
  <p>I've tried fetching manually via promise and it works but when I put everything into an array, it won't let me turn it into JSON. </p>
  
  <pre><code>      componentDidMount(){
          let allArticles = [];  
  
  
          for (let i=10; i&gt;1; i--){
            allArticles.push(fetch(BASE_URL + '&amp;page=' + i));
          }
          Promise.all(allArticles)
          .then(responses =&gt; {
            console.log(responses);
            const processedResponses = [];
            responses.map(response =&gt; {
              processedResponses.push(response);
            })
            //console.log(processedResponses);
          })
  
          //this works 
          // Promise.all([
          //   fetch(BASE_URL + '&amp;page=10'),
          //   fetch(BASE_URL + '&amp;page=9')
          // ])
          // .then(([response1, response2]) =&gt; Promise.all([response1.json(), response2.json()]))
          // .then(([data1, data2]) =&gt; this.setState({
          //   loading: false,
          //   dataSource: data1.articles.reverse()
          // }));
  </code></pre>