How to pass 'this' along with a function?
<p>I want to delegate some function calls from one object to another:</p>

<pre><code>objA.feature = objA.component.feature;
</code></pre>

<p>(Assuming <code>feature</code> is supposed to be a function both in objA and in its component)</p>

<p>But that clearly doesn't work, because the reference to <code>this</code> gets stripped from the function and ends up being a completely different object when it gets called (it actually is <code>objA</code> instead of <code>objB.component</code>).</p>

<p>You need to write something like this in order to get it to work:</p>

<pre><code>objA.feature = function() {
    objA.component.feature.apply(objA.component, arguments);
};
</code></pre>

<p>Is there a shorter (idiomatic) way to do that?</p>
