title: What does this javascript return statement mean?
body: <p>Please take a look at this <code>return</code> statement : </p>
  
  <pre><code>sortedNotes() {
        return (
          this.notes &amp;&amp;
          this.notes.sort((a, b) =&gt; {
            const aDate = new Date(a.createdAt)
            const bDate = new Date(b.createdAt)
            return bDate - aDate
          })
        )
      }
  </code></pre>
  
  <p>What does it mean?  Isn't that enough to be just like this : </p>
  
  <pre><code>sortedNotes() {
        return this.notes.sort((a, b) =&gt; {
            const aDate = new Date(a.createdAt)
            const bDate = new Date(b.createdAt)
            return bDate - aDate
          })
      }
  </code></pre>
  
  <p><strong>Update:</strong> </p>
  
  <p>To be more clear look at this: </p>
  
  <pre><code>return (foo &amp;&amp; bar);
  </code></pre>
  
  <p>what does this mean? If <code>foo</code> is true then return <code>bar</code> ??  then what about this: </p>
  
  <pre><code>return (bar &amp;&amp; foo);
  </code></pre>
  
  <p>What exactly is returned here?</p>