Exercise 8.2

This commit is contained in:
Karan
2021-11-24 21:08:44 +05:30
committed by GitHub
parent 46b30dcfd0
commit bb60aea39f
+6
View File
@@ -0,0 +1,6 @@
const arr = ["Laurence", "Mike", "Larry", "Kim", "Joanne", "Laurence", "Mike", "Laurence", "Mike", "Laurence", "Mike"];
const arr2 = arr.filter ( (value, index, array) => {
console.log(value,index,array.indexOf(value));
return array.indexOf(value) === index
});
console.log(arr2);