const unique = (str) => {
const cleanStr = str.replace(/ /gi, '');
const set = [...new Set(cleanStr)];
return set;
}
console.log(unique('asdqwe asdqwet dfadqwre '));
function checkForUnique(str){
var hashtable = {};
for(var i=0,len=str.length;i<len;i++){
if (hashtable[str[i]] != null){
hashtable[str[i]] = 1;
return false;
}else{
hashtable[str[i]] = 0;
}
}
return true;
}
const uniq = (str) => {
console.log(([...new Set(str)]).join(''))
}
uniq('hello')