Which technique for checking if a variable has been initialized is better/right? (Accepting the variable could hold anything (string, int, object, function, and so on))
if (elem) { // or !elem
or
if (typeof(elem) !== 'undefined') {
or
if (elem != null) {