I'm trying to sort an array of seasons by season and year, while removing duplicate seasons. The sort is not enough I guess I need to go by a regex but could not accomplish it
const myStringArray = ["Winter 17", "Summer 13", "Winter 15", "Summer 12", "Winter 17", "Summer 12", "Summer 17"]
console.log(_.uniq(myStringArray).sort(function(a, b) {
return b - a;
}));
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
return b - ato work when the values are strings, not numbers?