📌  相关文章
📜  异步函数 fetchJson - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:04.610000             🧑  作者: Mango

代码示例1
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));