Possible Duplicate:
Easiest way to find duplicate values in a JavaScript array
Let's say I have an array with thousands of elements and
I want to return true
if there are 2 or more elements with the same value.
I know I can run a for loop
and do a check on every pair of elements to find the answer.
But is there a faster way? And what's the best way?