How to sort array in javascript or typescript by a key but if key is same sort in alphabetical order? : <p>I have this array </p>

<pre><code>[   
  {
    "Books": [],
    "_id": "5dea9a11a8e1bf301c462ce4",
    "FileName": "AAAAA",
    "Order": 99999
  },
  {
    "_id": "5dea9864a8e1bf301c462cdb",
    "Books": [],
    "FileName": "some1",
    "Order": 3
  },
  {
    "Books": [],
    "_id": "5dea9873a8e1bf301c462ce1",
    "FileName": "among3",
    "Order": 3
  },
  {
    "Books": [],
    "_id": "5dea986ba8e1bf301c462cde",
    "FileName": "things2",
    "Order": 2
  },
  {
    "Books": [],
    "_id": "5dea9a18a8e1bf301c462ce7",
    "FileName": "FFFF",
    "Order": 99999
  },
  {
    "Books": [],
    "_id": "5dea9a1ea8e1bf301c462cea",
    "FileName": "BBBB",
    "Order": 99999
  }
]
</code></pre>

<p>Now I want to sort array by Order and if order is same then sort by alphabetically FileName.
So sorted array will look like this:</p>

<pre><code>[

 {
    "Books": [],
    "_id": "5dea986ba8e1bf301c462cde",
    "FileName": "things2",
    "Order": 2
  },

    {
    "Books": [],
    "_id": "5dea9873a8e1bf301c462ce1",
    "FileName": "among3",
    "Order": 3
  },
    {
    "_id": "5dea9864a8e1bf301c462cdb",
    "Books": [],
    "FileName": "some1",
    "Order": 3
  },

  {
    "Books": [],
    "_id": "5dea9a11a8e1bf301c462ce4",
    "FileName": "AAAAA",
    "Order": 99999
  },
  {
    "Books": [],
    "_id": "5dea9a1ea8e1bf301c462cea",
    "FileName": "BBBB",
    "Order": 99999
  },
   {
    "Books": [],
    "_id": "5dea9a18a8e1bf301c462ce7",
    "FileName": "FFFF",
    "Order": 99999
  },
]
</code></pre>

<p>I am able to do it in more than two loops but not sure how optimized is that. Looking for any optimized solution. Plain javascript or Typescript with Interface comparer will also work thanks.</p>
