I\'m writing a program that will print the unique character in a string (entered through a scanner). I\'ve created a method that tries to accomplish this but I keep getting
Here str will be your string to find the unique characters.
function getUniqueChars(str){ let uniqueChars = ''; for(let i = 0; i< str.length; i++){ for(let j= 0; j< str.length; j++) { if(str.indexOf(str[i]) === str.lastIndexOf(str[j])) { uniqueChars += str[i]; } } } return uniqueChars;
}