This option prohibits the use of the comma operator. When misused, the comma operator can obscure the value of a statement and promote incorrect code.
但我仍然不清楚 JSHint 正在寻找什么场景。有人可以举个例子吗?
最佳答案
The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand.
示例
function myFunc() {
var message = "hello";
return (message += "howareya", message);
}
// returns "hellohowareya"
关于javascript - JSHint 'nocomma' 选项有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35485621/