-4

There is an array, in that array there is an id, if id is repeated twice in the loop, remove the id from the array

1 Answers1

-1

use set

 let chars = ['A', 'B', 'A', 'C', 'B'];
    let unique = [...new Set(chars)];
    
    console.log(unique);

you will get output like this-> [ 'A', 'B', 'C' ]

rithuwa
  • 39
  • 5