When call the function below I am getting undefined for q. I do not know what to do. Please help. Thank you. I have tried passing q into then as a parameter but it does not work.
myfunction = () =>{
      
       sendFetch(
               `http://api.com`,
               GET
             ).then((response)=>{
              
               for (var i = 0; i < response.data.length; i++) {
                 processed_data.push(response.data[i].description);
               }
               
               for (var q = 0 ; q < array.length; q++)
               {
                sendFetch(
                  `api.com`,
                  GET
                ).then((response)=>{
                  
                console.log(q)
                 
                })
               }
              
               
             })
        
   } 
 
     
    