Function hasRepeatedItems

Check if there is at least one repeated item in the source array.

hasRepeatedItems([1, 2, 3]); // => false
hasRepeatedItems([1, 2, 3, 1]); // => true
  • Parameters

    • source: readonly unknown[]

      The array to check.

    Returns boolean

    true if there is at least one repeated item in the source array, false otherwise.