-4

I am accessing array which is in loop through:

var author = $$('.author').map(e=>e.textContent);

I want this to remove duplicate from array from authors list and fetch count and display on the front end. Does anyone know how to achieve this?

Imran Rafiq Rather
  • 7,677
  • 1
  • 16
  • 35

1 Answers1

1

Convert it to a set then back to an array:

[... new Set(author)];
Allan Wind
  • 23,068
  • 5
  • 28
  • 38