📜  从 json() javascript 代码示例获取 promise 结果

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

代码示例1
// Full request
fetch(myRequest)
  .then(response => response.json())
  .then(data => {
      console.log(data);
});
  
// Function that returns response
myFunction().then(data => {
      console.log(data);
});