📜  js 不等于 null - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:12.243000             🧑  作者: Mango

代码示例2
if (variable !== null) {
    //code
}

//Or, if you're expecting null as a string ('null'):

if (variable != null) {
    //code
}

//!== means not equal to, just like !=, but !== checks that the datatype is the same, whereas != doesn't.
//Example: (null !== "null") = true        (null != "null") = false