I am trying to loop through all pages of an API result that returns the next page as URL in the result:
const api_url= 'https://wger.de/api/v2/exercise/?format=json&page=29';
async function getExercises(){
const response = await fetch(api_url);
const data = await response.json();
data.results.forEach( item => console.log(item.name))
}
getExercises();
How would you go around doing this?