JS listener for global var?
<p>I want to keep everything contained within a single function, and not make all the various variables global.</p>

<p>Is it possible to set up an event listener within the function main to watch a global var?</p>

<p>in this example call doTheStuff() when the index is altered? or might I be going about this the wrong way?</p>

<pre><code>var index = 0;


function main(data, data, data, data, data, data,)
{

fucntion one(){ two() }

function two(){ three() }

function three(){ }

function doTheStuff(){ }

}
</code></pre>
