//SWAPI Links { async function jsonTable (obj){ for(let el in obj){ if(Array.isArray(obj[el])){ let i = 0 for(let elArr of obj[el]){ async function btn (link){ let res = await fetch(link) let data = await res.json() return obj[el][i]=data } if(elArr.indexOf("https://swapi.dev")!== -1){ await btn(elArr) } i++ } } if(obj[el].indexOf("https://swapi.dev")!== -1){ fetch(obj[el]) .then(res => res.json()) .then(luke => obj[el]=luke) } } console.log(obj) } fetch('https://swapi.dev/api/people/20') .then(res => res.json()) .then(luke =>jsonTable(luke)) }