const unique = (str) => { const cleanStr = str.replace(/ /gi, ''); const set = [...new Set(cleanStr)]; return set; } console.log(unique('asdqwe asdqwet dfadqwre '));