Quantum duality: variable is null and undefined at the same time?
Consider following JavaScript code (tested in Firefox):

    function f(a) {

      if (a == undefined) {
        alert('undefined');
      }
  
      if (a == null) {
        alert('null');
      }
    }

    f();


Both alerts are shown, suggesting that both statements are true.

Could you provide a reasonable explanation?
Quantum duality: variable is null and undefined at the same time?
===

Consider following JavaScript code (tested in Firefox):

    function f(a) {

      if (a == undefined) {
        alert('undefined');
      }
  
      if (a == null) {
        alert('null');
      }
    }

    f();


Both alerts are shown, suggesting that both statements are true.

Could you provide a reasonable explanation?