문자열에서 중복된 값을 제거할 때 new Set()과 스프레드 연산자 활용 가능 const str = "hello"; const arr = [...new Set(str)]; // ["h", "e", "l", "o"]; const result = arr.join(""); // "helo" 주어진 두 문자열이 애너그램으로 동일한 지 확인하려면 그냥 정렬해버리고 같은 문자인지 체크 const str1 = "hello"; const str2 = "oelhl"; str1.split("").sort().join("") === str2.split("").sort().join("") ? true : false; // true // 문자열을 배열로 변환 후 정렬하고 다시 문자열로 변환해서 같은 문자인지 체크. 팩토리얼 ..