// Ascending order
array.sort((a,b) => a-b)

// Descending order
array.sort((a,b) => b-a)