preserve context of variable assigned to an instance method
<p>This has been eluding me. Take the following code:</p>

<pre><code>function tSt( val ) {
    this.val = val;
}

tSt.func = function( x ) {
    return x * 2;
}

tSt.prototype.func = function() {
    return tSt.func( this.val );
}

var tmp = new tSt( 5 );

console.log( tmp.func());  // 10

var other = tmp.func;

console.log( other());  // undefined
</code></pre>

<p>The reason I want to be able to do this is for something like the following scenario:</p>

<pre><code>(function( funcarr ) {
    for ( var i = 0; i &lt; funcarr.length; i++ )
        console.log( funcarr[i]());
})([ tmp.func ]);
</code></pre>

<p>How can this be accomplished?</p>

<p><strong>Update:</strong></p>

<p>Here's a potentially more global solution, but I'm not sure if there are any drawbacks to doing it this way:</p>

<pre><code>function tSt( val ) {
    this.val = val;
    this.func = this.func.bind( this );
}

tSt.func = function( x ) {
    return x * 2;
}

tSt.prototype.func = function() {
    return tSt.func( this.val );
}
</code></pre>
