let nums = [4, 11, 2, 10, 3, 1];
console.log(nums.sort());
// 1, 10, 11, 2, 3, 4
let fruits = ['orange', 'apple', 'banana'];
console.log(fruits.sort());
// apple, banana, orange
심화
let ascendingOrder = nums.sort(
function(a, b){
return a-b
})
console.log(ascendingOrder)
// 1, 2, 3, 4, 10, 11
let descendingOrder = nums.sort(
function(a,b){
return b-a
})
console.log(descendingOrder)
// 11, 10, 4, 3, 2, 1