如下:uni-app,我想退出最里面的循环,用break居然报错?
list.forEach(a => {
let find = false;
items.forEach(b => {
if (b.pid == a.QID) {
find = true;
break; //这里报错了
}
})
})
e***@163.com
- 发布:2019-08-20 14:17
- 更新:2019-08-20 14:31
- 阅读:3000
forEach语句里不能用break吗?
分类:uni-app
3 个回复
cbj44125
不能,中断不了,改用 for (let a of list) 吧
5***@qq.com
好
9***@qq.com