I'm not sure I follow. If no duplicates are removed then that is just the original array is it not? Or do you mean you want an array with just ids 1, 2, and 3? If so, you can use Array.prototype.filter and only return true for the ids you want to keep.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Mayank,
I'm not sure I follow. If no duplicates are removed then that is just the original array is it not? Or do you mean you want an array with just
id
s 1, 2, and 3? If so, you can use Array.prototype.filter and only returntrue
for theid
s you want to keep.