Skip to content

Instantly share code, notes, and snippets.

@Xilesun
Last active November 11, 2022 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xilesun/7606d2ec03e9d084dbfbae21c0d7e2c0 to your computer and use it in GitHub Desktop.
Save Xilesun/7606d2ec03e9d084dbfbae21c0d7e2c0 to your computer and use it in GitHub Desktop.
rainforest QA problem solution
async function get(url) {
urlArr = url.split('?');
url = `${urlArr[0]}.json?${urlArr[1] || ''}`
const res = await fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
mode: 'cors'
});
return await res.json();
}
(async function() {
let data = await get('https://www.letsrevolutionizetesting.com/challenge')
while (data.message === 'This is not the end') {
data = await get(data.follow);
}
console.log(data);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment