这段代码的运行顺序为什么是这样的?

小程序 文章 2022-02-15 16:40 262 0 全屏看文

AI助手支持GPT4.0

这段代码的运行顺序为什么是这样的?Why is this code running in this order?

这段代码的运行顺序为什么是这样的?

这段代码的运行顺序是这样的:

1.wx.getUserProfile.

2.if循环

3.wx.getUserProfile.then

问题是:

1.为什么是如上顺序执行呢?

2.如果想先运行wx.getUserProfile和wx.getUserProfile.then之后再运行if循环,应该怎么写呢?

The running order of this code is as follows: 1 wx. getUserProfile. 2. If cycle 3 wx. getUserProfile. Then the question is: 1 Why is it executed in the above order? 2. If you want to run Wx first Getuserprofile and Wx getUserProfile. Then run the if loop again. How should I write it?

回答:

八九:

异步回调问题,可以百度了解下

Mr.Zhao:

异步问题,都写到then里面

15:

if循环写在then回调里面就好

brave:

异步。

-EOF-

AI助手支持GPT4.0