Difference between var someObj = {}; and var someObj = new RealObj
<p>So this is more of a question due to "not knowing the right word, thus I can't google it up" (I think).</p>

<p>What I have been wondering with javascript. One can create two "types" of Objects.</p>

<p>One would be: (or through using prototypes)</p>

<pre><code>function Foo(){
    this.bar = function(){};
}

var foo = new Foo();
</code></pre>

<p>The other one being:</p>

<pre><code>var foo = {
    bar : function(){}
};
</code></pre>

<p>The only few differences that I can come up with would be the fact that the former uses prototypes and can "extend" from other objects and also allows multiple instances where the latter can only have one instance and can't be extended (in the same way) (correct me if I am wrong)</p>

<p>However, in this case the variable named <code>var foo</code> has the exact same properties in both cases.</p>

<p>So for a concrete question: what is the name of the type of object being created (how can I search for more information on google for it) in the latter version and what differences are there between the two ways of creating an object?</p>
