Better way for writing JavaScript function
<p>The following ways of writing a javascript function are equivalent.</p>

<p>Maybe the first one is more clear.</p>

<p>Nevertheless, many programmers prefer the second way.</p>

<p>There are significant difference between the two ways for preferring the second-one?</p>

<p>First way:</p>

<pre><code>Class.prototype.fn = function () {
        var obj = { 
            … 
        };

        return obj;
};
</code></pre>

<p>Second way:</p>

<pre><code>Class.prototype.fn = function () {

        return {
            .........
          };
};
</code></pre>
