Javascript 反转if语句
我理解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 (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
}