title: Using Axios.all for an array of post calls in a for loop
body: <p>Currently I am trying to run a for loop that says for each JSON object in a array create an axios post call and add it to an Array. Then I am using Axios.all to call them all at once. The issue I'm having is the JSON post object is the same for each of the post calls. </p>
  
  <pre><code>let axiosArray = []
  let postData = {}
  for (int x = 0; x &lt; numOfItems; x++) {
  
  postData['size'] = shoe.size
  postData['color'] = shoe.color
  let newPromise = axios({
    method: 'post',
    url: postShoe,
    data: postData
  })
    .then(responsed =&gt; {
      console.log('success')
    })
    .catch(error =&gt; {
  
      console.log('error')
    })
    axiosArray.push(newPromise)
  }
    axios
  .all(axiosArray)
  .then(() =&gt; {
    console.log('submitted all axios calls')
  })
  .catch(error =&gt; {})
  </code></pre>
  
  <p>It runs two post calls like I want but its using the last value supplied to postData for each of the calls. I am wondering if there is a way to save all the data in the promise as it is when I create it and then on submit it will not only use the last value supplied to the postData.</p>