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.
How can I overcome this?
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.
Scroll down for the answers/solutions, because I have answered my own question Stack Overflow does not show it up. Be sure not to miss them.