How would I sort this data by count
and year
values in ascending order prioritizing on the count
value?
//sort this
var data = [
{ count: '12', year: '1956' },
{ count: '1', year: '1971' },
{ count: '33', year: '1989' },
{ count: '33', year: '1988' }
];
//to get this
var data = [
{ count: '1', year: '1971' },
{ count: '12', year: '1956' },
{ count: '33', year: '1988' },
{ count: '33', year: '1989' },
];
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…