Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

async function fetchJson

async function getUserAsync(name) 
{
  let response = await fetch(`https://api.github.com/users/${name}`);
  let data = await response.json()
  return data;
}

getUserAsync('yourUsernameHere')
  .then(data => console.log(data)); 
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #async #function #fetchJson
ADD COMMENT
Topic
Name
7+1 =