title: Axios response data to JSON
body: <p>I'm not familiar with JavaScript and Axios, so any help will be great :)</p>
  <p>My request from Axios to URL has this response.</p>
  <pre><code>data: '{&quot;id&quot;:&quot;test1&quot;, &quot;cool&quot;:&quot;test2&quot;}'
  </code></pre>
  <p>When trying JSON.parse like this</p>
  <pre><code>const buildArray = (await axios(config)).data
  let toJSON = JSON.parse(buildArray)
  </code></pre>
  <p>It gives me an error</p>
  <pre><code>Unexpected token  in JSON at position 0
  </code></pre>
  <p>Here it is my code and what I'm trying to do. For each Axios data response I want to add it to an array item and return it.</p>
  <pre><code>async function buildList(items, token){
  try {
      const list = []
      let config = ''
  
      for (item of items.items) {
          config = {
              method: 'get',
              url: 'https://my.domain.com/v1/customers/' + item.id,
              headers: {
                  'Authorization': 'Bearer ' + token,
                  'Accept': 'application/json'
              }
          }
  
          const buildArray = (await axios(config)).data
          list.push(JSON.parse(buildArray))
      }
  
      return list
  
  } catch (err) {
      throw Error ('buildList error: ', err.message)
  }
  }
  </code></pre>