Takes the first N elements from a readonly array or tuple T.
If T is a tuple, it returns a new tuple containing the first N elements.
If T is a general array, it returns the original array type T.
Type Parameters
Nextendsnumber
The number of elements to take.
Textendsreadonlyunknown[]
The readonly array or tuple type.
Returns
A new type containing the first N elements (for tuples) or T (for arrays).
Takes the first
Nelements from a readonly array or tupleT. IfTis a tuple, it returns a new tuple containing the firstNelements. IfTis a general array, it returns the original array typeT.