An easy way to find duplicates in an array
I was fiddling with my blog. Here is a simple puzzle solution which was finding a duplicate in an array. Array has only one duplicate in it. An easy solution is to use indexOf and lastIndexOf in Javascript.
Here is my findDuplicates function:
1 | function findDuplicate(array){ |