풀이 function solution(strings, n) { var answer = strings.sort((a, b) => a[n] === b[n] ? a.localeCompare(b) : a[n].localeCompare(b[n]) ); return answer; } sort() , localeCompare() 관련 참고 블로그 https://daniel-park.tistory.com/14 [Javascript] sort() 함수의 함정 Array.sort() 프로그래머스 알고리즘을 풀던 중 한 가지 사실을 알게 되었다. const array1 = [1, 30, 4, 21, 100000]; array1.sort(); console.log(array1); 다음 코드의 결과는 [1, 4, 21, 30,..