score:1

Accepted answer
export default function App() {
  const events = [
    {
        id: 1,
        name: "Event 1",
        tags: ["tag 1", "tag 2", "tag 3"]
    },
    {
        id: 2,
        name: "Event 2",
        tags: ["tag 1", "tag 3"]
    },
    {
        id: 3,
        name: "Event 3",
        tags: ["tag 1", "tag 3", "tag 2"]
    },
    {
        id: 4,
        name: "Event 4",
        tags: ["tag 1", "tag 5", "tag 3"]
    },
    {
        id: 5,
        name: "Event 5",
        tags: ["tag 3"]
    },
    {
        id: 6,
        name: "Event 6",
        tags: ["tag 2", "tag 3"]
    }
  ];  
  const result = [...new Set(events.flatMap(({tags}) => tags))].sort();
  return (
    <div>
      {
        result.map((tag,i) => <h1 key={i}>{tag}</h1>)
      }
    </div>
  );
}

Related Query

More Query from same tag