I know I can loop through the array and check all the other values for a match, but it seems like there should be an easier way.
### Similar question:
- https://stackoverflow.com/questions/1960473 There seems to be years of confusion about what this question asks. I needed to know what elements in the array were duplicated: "I just need to find what the duplicated values are". The correct answer should NOT remove duplicates from the array. That's the inverse of what I wanted: a list of the duplicates, not a list of unique elements.
以上就是Get all non-unique values (i.e.: duplicate/more than one occurrence) in an array的详细内容，更多请关注web前端其它相关文章！