---
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: 132
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/universe/length/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.7.0+

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

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

people |> length()// Returns 3

```

#### Related

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