在 Node.js(正在使用 MS Bot Framework)中,我尝试迭代包含 . 返回的多个对象的数组fetch()。它执行一次迭代,然后抛出一个错误。
我确实已经将节点获取从等式中剔除,并使用了对象的静态数组。我也尝试转换为数组。结果还是一样:TypeError: (images || []).forEach is not a function第一次迭代进展顺利。
这是目前的样子(为了可读性缩短了对象值):
\n\n// exact copy of what fetch returns\nlet test = [\n {\n title: 'Power BI Desktop\xe2\x80\x94Interactive Reports | Microsoft Power BI',\n link: 'https://support.office.com/',\n description: 'Create interactive reports with data',\n thumbnail: 'https://powerbi.microsoft.com/'\n }, {\n title: 'What is Power BI administration? - Power BI',\n link: 'https://support.office.com/',\n description: 'Learn about the configuration of Power BI ',\n thumbnail: 'https://learn.microsoft.com/'\n }, {\n …Run Code Online (Sandbox Code Playgroud)