Array Fill
This node creates an array of a specified size, filled with a specific value.
The Array Fill node initializes a fixed-size array with repeated data.
The Array Fill node generates a new array with Size elements, where every element is set to Element. This is useful for initializing grids, placeholders, or testing data.
| Data | Description |
|---|
| Size | The number of items to create. Max: 1,000,000. |
| Element | The value to fill the array with. Can be a number or string. |
Actions
| Signal | Description |
|---|
| Do | Triggers the creation. |
Outputs
Data
| Data | Description |
|---|
| Filled Array | The resulting array. |
Signals
| Signal | Description |
|---|
| Done | Triggered when the array is ready. |
Usage
Example Use Cases
- Placeholders: Create 5 "Loading..." items to show skeleton UI while data loads.
- Grid Initialization: Create an array of 64
0s for a chess board representation.
- Padding: Pad a list to ensure it has a minimum length.
Detailed Behavior
- Type Conversion: If
Element is a string that looks like a number (e.g., "42"), it tries to convert it to a number.
- New Array: Always creates a new array instance.
Troubleshooting
- Size Limit: Capped at 1 million items to prevent crashes.