-
Notifications
You must be signed in to change notification settings - Fork 0
API BooleanArray
Fixed-length packed array of Boolean values.
BooleanArray is a primitive-backed array for compact Boolean state such as visited sets, feature flags, and occupancy tables. Elements live in contiguous native storage and start as false.
The length is fixed at construction. push, pop, and element deletion are unavailable; elements are read and written through numeric indexes.
var visited = new BooleanArray(2);
visited[0] = true;
return visited[0]; // trueWarning
Indexing outside 0 to length - 1 raises a runtime error. Validate computed indexes before reading or writing.
Use Array instead when the element type must vary or when the collection has to grow.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
length |
number |
No | Non-negative element count. Omitting it creates an empty array. |
Returns
BooleanArray — a fixed-length array whose elements start at false.
Example
var flags = new BooleanArray(4);
return flags[3]; // falseReturns
number — the fixed element count.
Behavior
Read-only. The value never changes for a given instance.
Example
return new BooleanArray(6).length; // 6Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
boolean |
No | Value written to every element. Defaults to false. |
Returns
BooleanArray — this array, so calls can be chained.
Behavior
Every element is overwritten in place with the Boolean conversion of the value, using AuroraScript truthiness.
Example
var ready = new BooleanArray(3);
ready.fill(true);
return ready[2]; // trueAuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License