Created
October 26, 2020 20:56
-
-
Save allangrds/a899ffed035918dceac012fe4ae7ee74 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
Promise.all([ | |
fetch('https://api.github.com/users/iliakan'), | |
fetch('https://api.github.com/users/taylorotwell') | |
]) | |
.then(async([res1, res2]) => { //async function | |
const a = await res1.json(); | |
const b = await res2.json(); | |
console.log(a.login + ' has ' + a.public_repos + ' public repos on GitHub'); | |
console.log(b.login + ' has ' + b.public_repos + ' public repos on GitHub'); | |
}) | |
.catch(error => { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment