Whether or not you have already found a solution to your problem, I am here to offer you one of the most effective answers.
When it comes to Javascript, we have access to the powerful lodash library.
For detailed information, please check out the Lodash Documentation
Lodash is packed with numerous built-in functions such as filter, unique, isEqual, and many more.
Step 1:
Start by installing the npm package for lodash using the following command.
npm install lodash --save
Step 2:
Next, import the dependency into your component file.
import * as lodash from 'lodash';
Step 3:
Imagine you have an array named abcArr = [5,10, 8, 11, 10, 8];
And you want to remove all duplicate numbers.
Simply use the code snippet below to achieve the desired outcome.
let abcArr = [5,10, 8, 11, 10, 8];
let uniqueArr = [];
uniqueArr = lodash.uniqWith(abcArr, lodash.isEqual);
This will provide you with the solution you are looking for. Hopefully, this helps!