Remove Duplicates from Array

const basket = ['๐Ÿ‰', '๐Ÿ“', '๐Ÿ', '๐ŸŒ', '๐Ÿ', '๐Ÿ“'];
console.log(basket);

Using Set

// const fruits = [...new Set(basket)];
const fruits = Array.from(new Set(basket));
console.log(fruits);

Using Filter

const fruits = basket.filter(
  (item, index, items) => items.indexOf(item) === index
);
console.log(fruits);

Using Reduce

const fruits = basket.reduce(
  (unique, item) => (unique.includes(item) ? unique : [...unique, item]),
  []
);
console.log(fruits);