title: Reorder array based on values
body: <p>I have an array with classes (the class is called <code>Note</code>), and in those classes are basic values. Two important values are the <code>Note.Pinned</code> (boolean whether it's pinned or not) and <code>Note.Modified</code> (a timestamp when it was last edited).</p>
  
  <p>I would like to sort this array of classes by the <code>Modified</code> timestamp, then reorder it that the <code>Pinned</code> notes are on top of this list.</p>
  
  <p>I already tried sorting the notes.</p>
  
  <pre class="lang-js prettyprint-override"><code>const SortedNotes = Notes.sort((a, b) =&gt; a.Modified &gt; b.Modified);
  </code></pre>
  
  <p><code>Notes</code> being the array with classes.</p>
  
  <p>But, then, is there a better way to rearrange this array? Or is this the only method I can use?</p>
  
  <pre class="lang-js prettyprint-override"><code>SortedNotes.filter(n =&gt; n.Pinned).concat(SortedNotes.filter(n =&gt; !n.Pinned));
  </code></pre>
  
  <p>The above would work, and I know I can use <code>Array.prototype.partition</code>, so is there any other way of doing this?</p>
  
  <p>Thanks</p>