true if Arr is an array that includes elements of type T, otherwise false. An array of elements of type T is defined as Arr being a subtype of T[].
true
Arr
T
false
T[]
IsArrayIncludeTypeof<Record<string, number>[], number> // falseIsArrayIncludeTypeof<string[], null | boolean> // falseArrayIncludeTypeof<string[], string | boolean> // trueIsArrayIncludeTypeof<Record<string, number>[], Record<symbol, boolean>> // true, Copy
IsArrayIncludeTypeof<Record<string, number>[], number> // falseIsArrayIncludeTypeof<string[], null | boolean> // falseArrayIncludeTypeof<string[], string | boolean> // trueIsArrayIncludeTypeof<Record<string, number>[], Record<symbol, boolean>> // true,
Returns
true
ifArr
is an array that includes elements of typeT
, otherwisefalse
. An array of elements of typeT
is defined asArr
being a subtype ofT[]
.Example