if语句的确切反义是什么

p d*_*man -2 javascript

任何人都可以帮助完成以下行的完全相反.我试过插入不!但我认为我必须把它放在错误的地方.

if (email.indexOf("@") < 1 || email.lastIndexOf(".") < email.indexOf("@") + 2 || email.lastIndexOf(".") + 2 >= email.length) {
    alert ("I need this to show when the exact opposite of the if statement occurs")
}
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激

小智 5

让我们使用德摩根定律:

if(email.indexOf("@") >= 1 && email.lastIndexOf(".") >= email.indexOf("@") + 2 &&
email.lastIndexOf(".") + 2 < email.length)
{ 
    alert ("I need this to show when the exact opposite of the if statement occurs") 
};
Run Code Online (Sandbox Code Playgroud)

只是对所有文字进行否定并将"或"更改为"和"