Sort array of objects with date field by date
问题 Give the following array of objects, I need to sort them by the date field ascending. var myArray = [ { name: "Joe Blow", date: "Mon Oct 31 2016 00:00:00 GMT-0700 (PDT)" }, { name: "Sam Snead", date: "Sun Oct 30 2016 00:00:00 GMT-0700 (PDT)" }, { name: "John Smith", date: "Sat Oct 29 2016 00:00:00 GMT-0700 (PDT)" } ]; so that in this example, the final result would be John Smith, Sam Snead, and Joe Blow. I am trying to use lodash's _.sortBy(), but I can't get any sorting to take place no