Js if condition judgment, is this correct?

data[0].estate !== (0 || null || "")
Mar.16,2021

for not looking at your needs, others do not know, generally speaking, we write:

if (typeof data[0].estate !== 'undefined') {
    // 
}

if (!!data[0].estate) {
    //  undefined,null,0,'',false
}


// if && 
data[0].estate && doSomething()

// status
if (status) {
  // other code
}

// 
if (!!status) {
  // other code
}
Menu