skip to Main Content

Json – Fetch not syncing with for loop

I am trying to fetch json data from the unsplash api inside of a for loop but it will not sync with the loop. async function myfunction(){ for (x=0;x<=c.length-1; x++){ await fetch('https://api.unsplash.com/search/photos? client_id=123;query=' + c[x].value).then(function(response){ response.json().then(function(data) { //out of sync…

VIEW QUESTION
Back To Top
Search