array.toBool() function
array.toBool()
is experimental and subject to change at any time.
array.toBool()
converts all values in an array to booleans.
Supported array types
[string]
with valuestrue
orfalse
[int]
with values1
or0
[uint]
with values1
or0
[float]
with values1.0
or0.0
Function type signature
(<-arr: [A]) => [bool]
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]
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.