Checks if an array has at most a specific length.
const pair: readonly number[] = [1, 2] as const;const triple: readonly number[] = [1, 2, 3] as const;assert.isTrue(Arr.isArrayAtMostLength(pair, 2));assert.isFalse(Arr.isArrayAtMostLength(triple, 2));if (Arr.isArrayAtMostLength(pair, 2)) { assert.isTrue(pair.length <= 2);} Copy
const pair: readonly number[] = [1, 2] as const;const triple: readonly number[] = [1, 2, 3] as const;assert.isTrue(Arr.isArrayAtMostLength(pair, 2));assert.isFalse(Arr.isArrayAtMostLength(triple, 2));if (Arr.isArrayAtMostLength(pair, 2)) { assert.isTrue(pair.length <= 2);}
Checks if an array has at most a specific length.