title: How to order array objects by date?
body: <p>I have an array of objects like this</p>
  
  <pre><code>layerArr = [
              {
                 name: "layer 1"
                 layerDate: "/Date(6958748400000)/"
                 layerDateFormatted: "31 December 2018"
                 etc...
              }
              {
                 name: "layer 2"
                 layerDate: "/Date(9375937500000)/"
                 layerDateFormatted: "23 December 2017"
                 etc...
              }
              {
                 name: "layer 3"
                 layerDate: "/Date(1554764400000)/"
                 layerDateFormatted: "15 January 2018"
                 etc...
              }]
  </code></pre>
  
  <p>How can I sort layerArr by date with the latest date first?
  In this example, when layer 2 is sorted correctly, I also want the latest date to become layer 1 and the oldest date should become the last layer. (the example above is made up values)</p>
  
  <p>Thanks</p>
  
  <p>EDIT: the links suggested to other threads do not explain how to change "name" so that the latest date becomes <code>name ="layer 1"</code> all the way to the oldest date becoming the last layer. </p>