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: 
If you are wanting to assign a global variable only if it doesn't already exist, try:

```
window.someVar = window.someVar || 'hi';

```

or

```
window['someVar'] = window['someVar'] || 'hi';

```
> 
> 
> ```
> if (typeof someVar === "undefined") {
>     var someVar = "hi!";
> }
> 
> ```
> 
> 

will check if `someVar` (local or global) is undefined. 

If you want to check for a global variable you can use 

```
if(window['someVar'] === undefined) {
    ...
}

```

assuming this is in a browser :)