When using != instead of !==, it compares just the value, not the type. So, since myVar is of type "undefined", it is also equal to the ToString() of undefined making the first one return true if myVar is undefined. The second one does basically the same thing, though you could have used !== and gotten the same result (which isn't true for the first one). You could also simply do if (!myVar) since undefined is a falsy value.
-- Kevin