Skip to content

Instantly share code, notes, and snippets.

@elijahjcobb
Last active Jul 22, 2022
Embed
What would you like to do?
Fetch a GitHub user's info using the REST API
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}.`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment