这段代码的运行顺序是这样的:
1.wx.getUserProfile.
2.if循环
3.wx.getUserProfile.then
问题是:
1.为什么是如上顺序执行呢?
2.如果想先运行wx.getUserProfile和wx.getUserProfile.then之后再运行if循环,应该怎么写呢?
这段代码的运行顺序为什么是这样的?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?
回答:
异步问题,都写到then里面
if循环写在then回调里面就好
异步。
原文出处:这段代码的运行顺序为什么是这样的?
异步回调问题,可以百度了解下