// for TypeScript and JavaScript const initialArray = ['a', 'a', 'b',] finalArray = Array.from(new Set(initialArray)); // a, b