错误:当浏览器报node.ts:288 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
源代码截图:
原因:在遍历对象之前先进行判断,判断对象是否为空,然后再去遍历该对象
解决后代码截图:
错误:当浏览器报node.ts:288 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
源代码截图:
原因:在遍历对象之前先进行判断,判断对象是否为空,然后再去遍历该对象
解决后代码截图: