I have to make a function in JavaScript that removes all duplicated letters in a string. So far I\'ve been able to do this: If I have the word \"anaconda\" it shows me as a
Using Set() and destructuring twice is shorter:
Set()
const str = 'aaaaaaaabbbbbbbbbbbbbcdeeeeefggggg'; const unique = [...new Set([...str])].join(''); console.log(unique);