title: How to combine multiple response , where function take different parameter, to give different response from a single function?
body: <p>how do I combine multiple response, where function takes a different parameter, to give different response from a single function, I want all response should be combined in a single array.</p>
  <pre><code>const data = [
  {id:1,name:&quot;currency&quot;},
  {id:1,name:&quot;merchant&quot;},
  {id:1,name:&quot;broker&quot;},
  ]
  
  data.map(i=&gt;{
     getData(i.name)
  })
  getData(name){
  const response = getResponsedata(name);
  if (response?.data &amp;&amp; response?.status === 200) {
              setData(response.data);
    }
  }
  
  getResponsedata(name){
    try{
  const response = await axios.get(`/api/data/${name}`)
  return response
  }
  </code></pre>
  <p>here it gives me a different array, I want all in one</p>