Skip to content

length ​

The length() method returns the length of an array.

Interactive example ​

Syntax ​

typescript
function length<
	GenericInput extends readonly unknown[]
>(
	input: GenericInput
): GenericInput["length"]

Parameters ​

  • input: The array whose length you want to obtain.

Return value ​

The length of the array with precise typing.

See also ​

  • at - Returns the element at an index

Sources ​

Released under the MIT license.