1

Possible Duplicate:
Easiest way to find duplicate values in a javascript array

How do you find duplicated values in an array?

var arr = ['manager','manager','employee','manager',
           'director','employee','manager','operatives'];

Im looking to get the values that were duplicated to return in an array, in this case manager and employee, so the return value will be ['manager','employee'].

Community
  • 1
  • 1
manraj82
  • 5,929
  • 24
  • 56
  • 83

0 Answers0