Is it bad practice declaring global variables in a.js file?
<p>I have a .js file where I am initialising two parameters which are used
in a seperate function : </p>

<pre><code>var submyvar1;
var submyvar2;

function init(myvar1 , myvar2){
    submyvar1= myvar1;
    submyvar2= myvar2;
}

function (){
    //subvar1 &amp; subvar 2 used here
}
</code></pre>

<p>Is declaring global variables like this a bad practice ?</p>

<p>If so, what is the alternative, wrap the entire .js file in an object ?</p>
