问答题【253/1911】下面代码的输出是什么?

1const numbers = [1, 2, 3, 4, 5, 6]; 2 3numbers.forEach((num, index) => { 4 if (num === 3) { 5 console.log(`遇到数字 3,使用 return 跳过`); 6 return; 7 } 8 if (num === 5) { 9 console.log(`遇到数字 5,使用 return 跳过`); 10 return; 11 } 12 console.log(`处理数字: ${num}, 索引: ${index}`); 13});
难度:
2025-08-25 创建
想动手验证一下?打开练习场,写代码、看结果。在线练习

参考答案:

最近更新时间:2025-08-25

赞赏支持

题库维护不易,您的支持就是我们最大的动力!