【问题标题】:Reverse if statements反转 if 语句
【发布时间】:2017-01-16 12:54:38
【问题描述】:

我了解 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 if-statement conditional-statements


【解决方案1】:
if (!condition) {
    block of code to be executed if the condition is false
}

【讨论】:

    猜你喜欢
    • 2021-01-08
    • 2020-10-29
    • 1970-01-01
    • 2012-01-16
    • 2019-04-09
    • 1970-01-01
    • 2019-05-01
    • 2017-03-03
    相关资源
    最近更新 更多