Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 8, 2021 16:49
Embed
What would you like to do?
fetch(URL_TO_FETCH)
.then(response => response.json()) // retorna uma promise
.then(result => {
console.log(result);
})
.catch(err => {
// trata se alguma das promises falhar
console.error('Failed retrieving information', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment