Created
March 8, 2021 16:49
-
-
Save jaydson/30139e6efd5488b909966813ec971ae4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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