const names = ['John', 'Paul', 'George', 'Ringo', 'John']; let unique = [...new Set(names)]; console.log(unique); // 'John', 'Paul', 'George', 'Ringo'