const arr = ["d","b","a","c"]
console.log(arr.sort()) // ["a","b","c","d"]

const arr2 = [10,1,2,24,33,3]
console.log(arr2.sort()) // [1,10,2,24,3,33]

const arr3 = [10,1,2,24,33,3]
console.log(arr3.sort((x, y) => x - y)) // [1,2,3,10,24,33]

const arr4 = [10,1,2,24,33,3]
console.log(arr4.sort((x, y) => y - x)) // [33,24,10,3,2,1]

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.