title: sort an array by a boolean property in typescript
body: <p>I am using <code>angular 10</code> and I was wondering how can I sort this array</p>
  <pre><code>var dic = [
    { state: false, id: 1 },
    { state: true, id: 2} ,
    { state: false, id: 3 },
    { state: true, id: 4 },
    { state: false, id: 5 }
  ]
  </code></pre>
  <p>I want to sort by the value of the boolean <code>state</code>, so the result goes this way:</p>
  <pre><code>[
    { state: true, id: 2 },
    { state: true, id: 4 },
    { state: false, id: 1 },
    { state: false, id: 3 },
    { state: false, id: 5 }
  ]
  </code></pre>
  <p>The <code>true</code> value goes first in the array.</p>
  <p>What property or something from typescript I have to use to do that?</p>
  <p>Thank you!</p>