title: Javascript Array Specific Order
body: <p>I have an array of js object</p>
  
  <pre><code>const name = 'Levi'
  var data = [ 
  { firstname: 'Levi', food: 'apple'     },
  { firstname: 'Eren', food: 'orange'   },
  { firstname: 'Levi', food: 'grapes' },
  { firstname: 'Miks', food: 'banana' }
  ];
  </code></pre>
  
  <p>How can I sort the firstname and prioritized (Levi) as on top.</p>
  
  <p>Expected Output:</p>
  
  <pre><code>[{firstname: Levi, food: apple},
  { firstname: Levi, food: grapes },
  { firstname: Eren, food: orange   },
  { firstname: Miks, food: banana}]
  </code></pre>
  
  <p>I used this code </p>
  
  <pre><code>this.data.sort((a, b) =&gt; (a.firstname &gt; name) ? 1 : ((name&gt; a.firstname) ? -1 : 0));
  </code></pre>