Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

微信小程序 异步操作数组,为什么控制台看到的不对

代码如下
image.png

控制台打印数据如下
image.png

为什么在未push之前,数组内在控制台打印,也是有东西的呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

控制台里打印的是对象引用。

你要是只想打印当前的值,你就得 JSON.stringify 转成字符串输出。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...