Check if there is at least one repeated item in the source array.
hasRepeatedItems([1, 2, 3]); // => falsehasRepeatedItems([1, 2, 3, 1]); // => true Copy
hasRepeatedItems([1, 2, 3]); // => falsehasRepeatedItems([1, 2, 3, 1]); // => true
The array to check.
true if there is at least one repeated item in the source array, false otherwise.
true
false
Check if there is at least one repeated item in the source array.
Example