Invoking a function Object in Javascript
<p>I have a small question in javascript.
Here is a declaration:</p>

<pre><code>    function answerToLifeUniverseAndEverything()
    {
       return 42;
    }

    var myLife = answerToLifeUniverseAndEverything();
</code></pre>

<p>If I do <code>console.log(myLife)</code>
It'll print 42, as I am just invoking the same instance of function resulting in 42 as the answer. (Basic rule on javascripts that only references of objects are passed and not the object)</p>

<p>Now on the other hand if I do</p>

<pre><code>var myLife = new answerToLifeUniverseAndEverything();
</code></pre>

<p>Then I can't invoke the function; instead myLife becomes just an object? I understand that this is a new copy of the same function object and not a reference; but why can't I invoke the method?</p>

<p>Can you please clarify the basic fundamental I am missing here?</p>

<p>Cheers</p>
