Calling Javascript Factory Method
<p>I am learning Object Oriented Java Script. I have below code for Factory Method.</p>

<pre><code>function Foo() {
    var value = 1;
    return {
        method: function() {
            return value;
        },
        value:value
    }
}
Foo.prototype = {
    bar: function() {}
};

new Foo();
Foo();
</code></pre>

<p>method Foo can be called by two ways. <code>new Foo();</code> or <code>Foo();</code> Both do the same thing and output is same. what is actual difference in java script processing ?</p>
