Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 反转if语句_Javascript_If Statement_Conditional Statements - Fatal编程技术网

Javascript 反转if语句

Javascript 反转if语句,javascript,if-statement,conditional-statements,Javascript,If Statement,Conditional Statements,我理解if条件是如何工作的。像这样: if (condition) { block of code to be executed if the condition is true } 但是,如果语句正确,我如何反转,例如不要触发这行代码 if $("span:contains('399')) { block of code to be executed if the condition is false } javascript 101。。。如果条件{…} if (!cond

我理解if条件是如何工作的。像这样:

if (condition) {
    block of code to be executed if the condition is true
}
但是,如果语句正确,我如何反转,例如不要触发这行代码

if $("span:contains('399')) {
    block of code to be executed if the condition is false
}
javascript 101。。。如果条件{…}
if (!condition) {
    block of code to be executed if the condition is false
}