Remove Duplicates Arrays in Javascript
All we need do is to initialize a new set and pass in the required array we need to remove duplicates from as shown below.
const array = ["ade", "kemi", "bose", "esther", "felele", "ade"];
const uniqeSet = new Set(array);
/* this by default returns back an object of the unique value passed in the array * above which we can spread in an array.
*/
// Set {"ade", "kemi", "bose", "esther", "felele"}
const arrayResponse = [...uniqeSet];
// ["ade", "kemi", "bose", "esther", "felele"]