- satisfies<T>(index: number, condition: ((x: T) => boolean)): ((arr: readonly T[]) => boolean)
-
Parameters
-
index: number
-
condition: ((x: T) => boolean)
-
- (x: T): boolean
-
Returns boolean
Returns ((arr: readonly T[]) => boolean)
-
- (arr: readonly T[]): boolean
-
Returns boolean
Returns
trueif the array element atindexexists and satisfiescondition. Negative indices count backwards from the end of the array.Remarks
This function is designed to improve developer experience by eliminating the need to account for the
undefinedtype when accessing an array element.Example