title: Two javascript functions not working as same way
body: <p>I have written 2 javascript function but they are not working as same.</p>
  
  <p><code>console.log(func2());</code> is undefined. Can anyone tell me why and how to solve this?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function func1()
  {
    return {
        bar: "hello"
    };
  }
  
  function func2()
  {
    return
    {
        bar: "hello"
    };
  }
  
  console.log(func1());
  console.log(func2());</code></pre>
  </div>
  </div>
  </p>