Skip to content

assertcheck v1.0.0


assertcheck / assert / first

Function: first()

ts
function first<T>(
   arr, 
   expected, 
   opts?): void;

Defined in: src/assert.ts:1237

Asserts that the first element equals expected — Ruby arr.first.

Type Parameters

Type Parameter
T

Parameters

ParameterType
arrT[]
expectedT
opts?Opts

Returns

void

Example

ts
`assert.first(sorted, lowestId, "first element must be the lowest id")`

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