gpt4 book ai didi

javascript - 意外 'continue'

转载 作者:行者123 更新时间:2023-12-03 03:14:10 35 4
gpt4 key购买 nike

我有:

while (i < l) {
if (one === two) { continue; }
i++;
}

但是 JSLint 说:

Problem at line 1 character 20: Unexpected 'continue'.

if (one === two) { continue; }

我犯了什么错误?我的代码实际上应该是什么样子?

最佳答案

来自the JSLint docs :

continue Statement

Avoid use of the continue statement. It tends to obscure the control flow of the function.

因此,如果您想遵守 JSLint 遵循的约定,请将其完全删除。

关于javascript - 意外 'continue',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6071762/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com