---
title: array.toBool() function
description: array.toBool() converts all values in an array to booleans.
url: https://docs.influxdata.com/flux/v0/stdlib/experimental/array/tobool/
estimated_tokens: 238
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/experimental/array/tobool/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.184.0+

InfluxDB support

> [!Important]
> `array.toBool()` is experimental and [subject to change at any time](/flux/v0/stdlib/experimental/#experimental-packages-are-subject-to-change).

`array.toBool()` converts all values in an array to booleans.

#### Supported array types

* `[string]` with values `true` or `false`
* `[int]` with values `1` or `0`
* `[uint]` with values `1` or `0`
* `[float]` with values `1.0` or `0.0`

##### Function type signature

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

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

## Parameters

### arr

Array of values to convert. Default is the piped-forward array (`<-`).

## Examples

### Convert an array of integers to booleans

```
import "experimental/array"

arr = [
    1,
    1,
    0,
    1,
    0,
]

array.toBool(arr: arr)// Returns [true, true, false, true, false]

```

[type-conversions](/flux/v0/tags/type-conversions/)
