Assuming the foo is declared as a non-primitive type variable, but might be uninitialized, is there any possibility to use on non-primitive object comparison as this:
if (foo) {
...
}
or is it better to do it the longer way like this?
// not using "===" here on purpose, because the variable is non-primitive, so the value can't be 0 or empty string
if (foo != null) {
...
}
If it is not equal, then why.