for (const number of numbers) { if (number > 3) { break; // 成功中断循环 } console.log(number); }
forEach 停止
最新推荐文章于 2024-11-02 12:42:04 发布
for (const number of numbers) { if (number > 3) { break; // 成功中断循环 } console.log(number); }