Fetch 回调函数里赋值失效 bug吗?

#1
let info = [];

fetch('url', {
      method: 'POST',
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      body: JSON.stringify({
        "m": "activity",
        "c": "youxi",
      })
    }).then(res => res.json()).then(json => {
      if (json.status === 0) {
        Toast.success("获取成功");
        info = json.data.map((v, i) => {
          return {label: v.name, ratio: v.rate}
        });
       console.log(info) // 这里可以正常输出
      } else if (json.status === 1) {
        Toast.fail("获取失败")
      }
    })
    .catch(error => {
      throw error
    });

   console.log(info) // 这里不可以正常输出 想让他在这也正常输出
#2

异步操作,不能直接赋值

#3

有没有啥好的办法呢,除了延时

#4

我在另一个帖子里面回复你了,貌似也是你的帖子