// 请问当查到的学生年龄大于18时,怎么跳出当前循环 db.student.find().forEach(function(x){ if(x.age > 18){ break; // 这里报语法错误 } })
欢迎选择我的课程,让我们一起见证您的进步~~
return;Because the callback of forEach is a function; break and continue can be used in the for() loop
return;
return;
Because the callback of forEach is a function;
break and continue can be used in the for() loop