length

Returns the number of characters in a string, or the length of an array.

length

Returns the number of characters in a string, or the length of an array.

Type: transform

Aliases

count, size

Parameters

  • input (unknown): The input can be a string, an array, or an object.

Returns

Type: number

The number of characters in a string, or the length of an array.

Examples

length("hello") // 5
length([1, 2, 3]) // 3
Cookie Notice

We use cookies to enhance your browsing experience.