I have an array of objects example
var objects = [
{ first_nom: 'dave', value: '5'},
{ first_nom: 'roger', value: '-0'},
{ first_nom: 'pete', value: '+0' },
{ first_nom: 'pete', value: '-5' },
];
Sorting this by value would ideally reverse the two zeros.
I have tried the normal javascript/jquery and underscore sorts but they ignore the leading -
or +
and probably rightly so.
This is what I currently have (this sorts fine but ignores the + and -):
var chartData = _.sortBy(objects, 'value').reverse();
Is there anything else someone can recommend please?
Many thanks
Nev