I have the fallowing data:
const data = [
{
data1:
{
title: 'Scaling 100k users',
upvotes: 72,
date: '2019-01-21'
}
},
{
data2:
{
title: 'the emu War',
upvotes: 24,
date: '2019-10-21'
}
},
{
data3: {
title: 'Alphabet earnings',
upvotes: 22,
date: '2019-11-23'
}
},
{
data4: {
title: 'A message to our customers',
upvotes: 12,
date: '2019-01-24'
}
},
{
data5: {
title: 'Simple text editor has 15k monthly users',
upvotes: 7,
date: '2019-12-31'
}
},
{
data6: {
title: 'Artificial Mountains',
upvotes: 75,
date: '2019-11-22'
}
},
{
data7: {
title: 'What\'s SAP',
upvotes: 1,
date: '2019-11-21'
}
},
{
data8: {
title: 'Eating glass',
upvotes: 172,
date: '2019-01-01'
}
}
]
I want to obtain a list sorted by values:
1.from more to less upvotes
2.from more recent to less recent date
It is due an homework I am doing and I think if I achive this I can be a better programmer, but I am only obtaining individual sorted values
thank to all forr your time