JavaScript Program to Remove Duplicates From Array
// program to remove duplicate value from an array
function getUnique(arr){
let uniqueArr = [];
// loop through array
for(let i of arr) {
if(uniqueArr.indexOf(i) === -1) {
uniqueArr.push(i);
}
}
console.log(uniqueArr);
}
const array = [1, 2, 3, 2, 3];
// calling the function
// passing array argument
getUnique(array);
Output
[1, 2, 3]
