title: Sort null values to last in Array of Objects
body: <p>I have an array of objects as follows:</p>
  
  <pre><code>c = [{a: null}, {a: 12}, {a: 1}, {a: 50}, {a: 2}, {a: null}]
  </code></pre>
  
  <p>I want to kind-of sort them by the objects having values first then objects with null.</p>
  
  <p>What I tried is:</p>
  
  <pre><code>c.sort(function(b) { return b.a ? -1 : 1 })
  </code></pre>
  
  <p><strong>OUTPUT</strong></p>
  
  <pre><code>[{a: 2}, {a: 50}, {a: 1}, {a: 12}, {a: null}, {a: null}]
  </code></pre>
  
  <p><strong>EXPECTED OUTPUT</strong></p>
  
  <pre><code>[{a: 12}, {a: 1}, {a: 50}, {a: 2}, {a: null}, {a: null}]
  </code></pre>
  
  <p>How can I achieve this?</p>