---
title: length() function
description: length() returns the number of elements in an array.
url: https://docs.influxdata.com/flux/v0/stdlib/universe/length/
estimated_tokens: 485
product: Flux
version: v0
---

# length() function

-   Flux 0.7.0+
-   View InfluxDB support

`length()` returns the number of elements in an array.

##### Function type signature

```js
(<-arr: [A]) => int
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### arr

Array to evaluate. Default is the piped-forward array (`<-`).

## Examples

### Return the length of an array

```js
people = ["John", "Jane", "Abed"]

people |> length()// Returns 3

```

#### Related

-   [Work with arrays](/flux/v0/data-types/composite/array/)
