I'm trying to sort the following object's keys properly:
const data = {
'0 - 4': [...],
'5 - 9': [...],
'10 - 14': [...],
'15 - 19': [...],
};
By doing:
const sort = R.sortBy(R.toLower);
return R.compose(sort, R.keys)(data);
But it always ends up coming out as:
['0 - 4', '10 - 14', '15 - 19', '5 - 9'];
Because it's treating the numbers as a string and a string that starts with 5 is supposedly higher than a string that starts with a 1. Would anyone know how to use Ramda to properly sort this so that it comes out as
['0 - 4', '5 - 9', '10 - 14', '15 - 19'];