我目前正在学习 Javascript,距离我以 C++ 为中心的编程课程的期末考试不到一周,并且C++
循环会停止,i!<10
但我假设它会在 JS 中继续运行,因为我在 9 点之后得到输出。
我在 Chrome 中使用 JS 控制台
代码和输出是:
for (i=0; i<10; i++){
console.log("This is the number" + i.toString());
}
This is the number0
This is the number1
This is the number2
This is the number3
This is the number4
This is the number5
This is the number6
This is the number7
This is the number8
This is the number9
undefined