How to add a extra object to a variable argument function in Javascript?
<p>P.S.: I am not asking how to pass a function to a function! I am asking how to add a argument after passing a function.</p>

<p>I want to pass functionA as a variable to functionB, and add a extra object to functionA inside functionB. How can I do this?</p>

<pre><code>function functionA() {
    console.log( arguments );
}
function functionB( fn ) {
    fn( {
        c : 'extra object',
    });
}
functionB( function() {
    functionA( {
        a : 'foo',
        b : 'bar',
    })
});
</code></pre>

<p>this is the result:</p>

<pre><code>{ '0': { a: 'foo', b: 'bar' } }
</code></pre>

<p>but what I want is:</p>

<pre><code>{ '0': { a: 'foo', b: 'bar', c: 'extra object' } }
</code></pre>