Javascript中的运算符不会出现意外的令牌错误

coo*_*r15 -1 javascript if-statement not-operator logical-operators

!在这个条件中使用not运算符()给了我:

"未捕获的SyntaxError:意外的令牌!"

if (text.includes(input[j])) {
   $(Messages[i]).hide();
}
else if !(text.includes(input[j])) {
   $(Messages[i]).show();
}
Run Code Online (Sandbox Code Playgroud)

为什么不在!这里工作?

pot*_*hin 7

!应该在():

else if (!text.includes(input[j]))
Run Code Online (Sandbox Code Playgroud)