有条件或陈述困难

I am iterating through an HTMLCollection looking for innerText if there is innerText I will know that there is an error on the page. However, in some instances innerText === undefined and other times innerText === "" so I have an or statement in my if block.

我的想法是,这应该很简单:

if(err_field[field].innerText !== undefined || err_field[field].innerText !== ""){
      no_error = false;
    }

This doesn't work, I can log out the innerText of each field and clearly see that they are all either undefined or "".

因此,在花了半个小时弄乱它的变化之后,我改变了策略:

    if (err_field[field].innerText === undefined || err_field[field].innerText === "") {
    }else {
      no_error = false;
    }

This works. Why? As far as I an tell it's just an inverse of the above including some more overhead an unnecessary else statement. Am I missing something? I've tried several variations including if (err_field[field].innerText || ...) and if (err_field[field].innerText != null || ...) nothing has worked except the example above.