Skip to main content

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.

Inputs

Input

DataDescription
SizeThe number of items to create. Max: 1,000,000.
ElementThe value to fill the array with. Can be a number or string.

Actions

SignalDescription
DoTriggers the creation.

Outputs

Data

DataDescription
Filled ArrayThe resulting array.

Signals

SignalDescription
DoneTriggered when the array is ready.

Usage

Example Use Cases

  1. Placeholders: Create 5 "Loading..." items to show skeleton UI while data loads.
  2. Grid Initialization: Create an array of 64 0s for a chess board representation.
  3. Padding: Pad a list to ensure it has a minimum length.

Detailed Behavior

  1. Type Conversion: If Element is a string that looks like a number (e.g., "42"), it tries to convert it to a number.
  2. New Array: Always creates a new array instance.

Troubleshooting

  • Size Limit: Capped at 1 million items to prevent crashes.