I am checking if a variable is defined or not, and if it is not defined explicitly I am going to define it by doing:
if ( typeof(aVariable) == 'undefined' ) {
var aVariable = value;
}
Because the variable is not defined JSLint warns that it is used before it is defined, and that is exactly what I want.
What is the best practice to overcome this?
Update
I want to enable defining those variables explicitly doing this:
<script>
var aVariable = value;
</script>
<script src="myScript.js"></script>
So everyone who is going to include this script can customize some of the properties. And I am afraid I cannot change this logic because it is already being used in hundred of web sites this way.