define local variable in some given scope
<p>How could I define local variable in some given scope?  </p>

<pre><code>var f = function() {
    // (1) var localVariable = 'some value';
    alert(localVariable);
}

var defineLocalVariable = function(fnTarget) {
    // (2) fnTarget['localVariable'] = 'blah...';

    /* (3)
    with (fnTarget) {
        var localVariable = 'blah...'
    } */
}

defineLocalVariable(f);
f();
</code></pre>

<p>Look at example. If uncomment (1) code will alert value of local variable of 'f' function 'some value'. What if I want to define this local variable programmatically in runtime, is it feasible? Could you propose implementation of 'defineLocalVariable' function to define local variable in 'f', something like (2) or (3) which are not working solutions.  </p>

<p>Thanks.</p>
