Explore the different ways to sort Arrays in Javascript
const list = [1,6,3,8,3,2]
const sortedList = list
.slice()
.sort((a, b) => a.upvotes - b.upvotes);
const list = [1,6,3,8,3,2]
const sortedList = list
.slice()
.sort((a, b) => b.upvotes - a.upvotes);