Arrays.hasMultiple()
Syntax
function hasMultiple<T>(array: readonly T[], value: T): boolean
Returns true
if the array contains multiple of the specified value.
Parameters | |
array
|
An array with any number of elements. |
value
|
The value to check for multiples on array. |
Example
import { Arrays } from 'potence';
const array = [0, 1, 2, 2, 3];
Arrays.hasMultiple(array, 2); // -> true
Arrays.hasMultiple(array, 0); // -> false
Remarks
This function only compares values for value types, otherwise it compares references.