function removeDuplicateCharsIgnoreCaseAndSort(string) { let set = new Set(); for(let char of string) { set.add(char.toLowerCase()); } let array = Array.from(set).sort(); return array.join(''); } const inputStr = 'BbAaCcDdEeBb'; const uniqueSortedStr = removeDuplicateCharsIgnoreCaseAndSort(inputStr); console.log(uniqueSortedStr);