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
const username = "elijahjcobb"; | |
fetch(`https://api.github.com/users/${username}`) | |
.then(res => res.json()) | |
.then(gist => { | |
const {name, company, location} = gist; | |
console.log(`${name} works at ${company} in ${location}.`); | |
}); |
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
const id = "<the-gist-id>"; | |
fetch(`https://api.github.com/gists/${id}`) | |
.then(res => res.json()) | |
.then(gist => { | |
const {createdAt, description} = gist; | |
console.log(`The ${description} gist was created at ${createdAt}!`); | |
}); |