问题:Cannot read properties of undefined (reading 'length') 分析:这个时候不是集合,在遍历之前最好先做一下判断,不是集合的话不要进行遍历,避免影响下面的代码无法执行。 问题解决!