splice

This block is part of the array group and was last modified in core v10.4.28.

splice v10.4.28

Removes an item from your given array.

In pins 3
  • array
    array

    The array you want to remove an item from (optional).

  • start required
    number

    The index at which to start removing items from the array.

  • deleteCount
    number

    The number of items to remove from the array (optional).

Out pins 2
  • Array
    array

    The array after removing items.

  • Removed items
    array

    The items that were removed from the array.

Removes elements from a COPY of the array starting at zero-based index start: with deleteCount wired it removes that many elements (negative counts as 0); WITHOUT deleteCount it removes everything from start through the end. Outputs the remainder on array and the removed elements on removed_items; the input is not mutated. Negative start clamps to 0 - it does not count from the end - and nothing can be inserted.

A typical wiring for splice: number feeds the number_1 pin; sort array by field feeds the array pin; the array out pin feeds map.

Studio canvas example for the splice block: typical wiring for splice.

Commonly used with

In production blueprints, this block is most often wired together with:

  • number: feeds into this block. Generates a valid number from the filled custom value in the blueprint.
  • map: this block feeds into it. Creates a new array with the results of the provided function on every element in the array.
  • sort array by field: feeds into this block. Sorts the elements of an array by a given key.

Version history

Introduced in v10.4.28.


Back to array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group