Why is same return type but result is difference
<p>I have two function of same return type in java script but return type is difference. The using code of snipped id below </p>

<pre><code>function foo1()
    {
      return {
          bar: "hello"
      };
    }

    function foo2()
    {
      return
      {
          bar: "hello"
      };
    }
</code></pre>

<p>calling the function..</p>

<pre><code>console.log("foo1 returns:");
console.log(foo1());
console.log("foo2 returns:");
console.log(foo2());
</code></pre>

<p>Output the result ....</p>

<pre><code>foo1 returns:
Object {bar: "hello"}
foo2 returns:
undefined 
</code></pre>