duplicates = false; for(i = 0; i < arr.length; i++) { for(j = i + 1; k < arr.length; j++) { if(j != i && arr[j] == arr[i]) { duplicates = true; } } }