1let strArray = [ "q", "w", "w", "w", "e", "i", "u", "r"];
2let findDuplicates = arr => arr.filter((item, index) => arr.indexOf(item) != index)
3
4console.log(findDuplicates(strArray)) // All duplicates
5console.log([...new Set(findDuplicates(strArray))]) // Unique duplicates
1duplicates = false;
2
3for(i = 0; i < zipcodeList.length; i++) {
4 for(j = i + 1; k < zipcodeList.length; j++) {
5 if(j != i && zipcodeList[j] == zipcodeList[i]) {
6 duplicates = true;
7 }
8 }
9}