diff --git a/Chapter 8/exercise 6 b/Chapter 8/exercise 6 new file mode 100644 index 0000000..4324c0b --- /dev/null +++ b/Chapter 8/exercise 6 @@ -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);