Possible to scope a javascript variable to a function and that function's recursive calls to itself?
<p>I am in a situation where I have a loop that is calling a function.  The function will make recursive calls to itself once called.</p>

<p>Is there a way that I can scope a variable to the function and the chain of recursive calls generated from the first call?</p>

<p>Something like this:</p>

<pre><code>for(var i=0;i&lt;100;i++)
{
  myFunction();
}

function myFunction()
{
   var someNumber = 200;
   someNumber -= 10;
   if( someNumber &gt; 0)
   {
      myFunction();
   }
}
</code></pre>

<p>where at the second iteration of the first call to someNumber would be 190 and not 200.  Is this possible to accomplish?</p>

<p>If there is anything confusing here, please let me know.</p>
