即使数组已填充,Javascript长度也将返回0

时间:2020-05-26 20:42:21

标签: javascript arrays

我正在尝试遍历2个json文件。所以我创建了函数。该功能的结果被推送到“响应”数组中。但是,当我尝试记录数组的长度时,它返回0。似乎该数组为空,但是当我检查控制台时,它会显示结果。

这是我当前的代码:

<img src="static/programming.gif" alt="Computer man" style="width:148px; hei  ght:148px;">

这是数组的结果: array collapsed array expanded with results

0 个答案:

没有答案