title: Javascript - get 1 oldest date from array of dates
body: <p>I have an array with this format. I just want to pull the 1 oldest date.</p>
  
  <p>This is value in array looks like:</p>
  
  <h1>Array:</h1>
  
  <p>creationDate = ['Wed Feb 13 21:14:55 GMT 2019','Wed Feb 13 21:19:42 GMT 2019','Wed Feb 13 21:28:29 GMT 2019','Wed Feb 13 21:31:04 GMT 2019'];</p>
  
  <p>This is my code:</p>
  
  <h1>Code:</h1>
  
  <pre><code>        // this below code is not working as expected   
          if(creationDate){
              var orderedDates = creationDate.sort(function(a,b){
                  return Date.parse(a) &gt; Date.parse(b);
              }); 
          }
  </code></pre>
  
  <h1>Expected Result:</h1>
  
  <p>Wed Feb 13 21:14:55 GMT 2019</p>