While literally using the keyword undefined, boolean(undefined) works, trying that with an undefined variable doesn't work, and that is the whole point of doing the check for null or undefined. Deseo determinar si una variable no está definida o si tiene el valor nulo. En el siguiente ejemplo, quiero que se ejecute la clásula correspondiente a la condición verdadera, es decir se imprima

You can check the type of the variable: