title: How to order the item categories in Javascript
body: <p>I am having 20 records</p>
  
  <p>I want to order the records in terms of <code>Priority</code> field.</p>
  
  <p><code>Priority</code> field is having 3 values( <code>High, Medium, Low</code> )</p>
  
  <p>I want to display the records in <code>High, Medium, Low</code> records in sequence respectively.</p>
  
  <p>Below is <code>C#</code> version ---> I need this to do in <strong>javascript</strong></p>
  
  <pre><code>`var groupedRecords = records.OrderByDescending(x =&gt; x.Priority == "High").ThenByDescending(x &gt; x.Priority == "Medium").ThenByDescending(x &gt; x.Priority == "Low")`
  </code></pre>
  
  <p>In Javascript,</p>
  
  <p><code>var csvRecords = priorities.split(',');</code> // Now I am getting the csv with mixed orders. I need in sequence. 
          That is I want to get <strong>first</strong> all High records, <strong>then</strong> Medium records and <strong>atlast</strong> Low records.</p>