Skip to content

assertcheck v1.0.0


assertcheck / assert / len

Function: len() ​

ts
function len<T>(
   arr, 
   n, 
   opts?): void;

Defined in: src/assert.ts:761

Asserts that the array has exactly n elements.

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
arrT[]
nnumber
opts?Opts

Returns ​

void

Example ​

ts
`assert.len(users, 10, "expected 10 users")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.