Remova o valor duplicado da string
// remove duplicate value from string
let str = "a b a";
let words = str.toLowerCase().split(" ");
const remDuplicate = words.filter((data,index,src)=>{
return src.indexOf(data)===index
})
console.log("remDuplicate =>",remDuplicate)
Abhishek