Question: JSLint is not passing this as a valid code:

```
/* global someVar: false */
if (typeof someVar === "undefined") {
    var someVar = "hi!";
}

```

What is the correct way?

Answer: 
I think this is actually a problem with JSLint. It will issue the following error:

> 
> Unexpected 'typeof'. Compare directly with 'undefined'.
> 
> 
> 

I believe this is bad advice. In JavaScript, `undefined` is a global variable that is, usually, undefined. But some browsers allow scripts to modify it, like this: `window.undefined = 'defined'`. If this is the case, comparing directly with `undefined` can lead to unexpected results. Fortunately, current ECMA 5 compliant browsers do not allow assignments to `undefined` (and will throw an exception in strict mode).

I prefer `typeof someVar === "undefined"`, as you posted, or `someVar in window` as Susei suggested.
This would be a simple way to perform the check .

But this check would fail if `variableName` is declared and is assigned with the `boolean value: false` 

```
if(window.variableName){

}

```