JavaScript - SORT
sort () 메서드는 배열의 요소를 적절한 위치에 정렬하고 배열을 반환합니다. 종류가 반드시 안정적 일 필요는 없습니다. 기본 정렬 순서는 문자열 유니 코드 코드 포인트에 따릅니다. arr.sort() arr.sort(compareFunction) var fruit = ['cherries', 'apples', 'bananas']; fruit.sort(); // ['apples', 'bananas', 'cherries'] var scores = [1, 10, 21, 2]; scores.sort(); // [1, 10, 2, 21] // 10이 2, // Unicode 코드 포인트 순서에서 '10'이 '2'앞에 오기 때문에. var things = ['word', 'Word', '1 Word', '2 Wo..