slice

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

slice v10.4.28

returns a shallow copy of a portion of an array into a new array object selected from start to end

In pins 3
  • array required
    array

    The array from which a slice will be created.

  • begin required
    number

    The index at which the slice will start.

  • end
    number

    The index at which the slice will end (optional).

Out pins 1
  • Array
    array

    The resulting slice of the array.

Returns a copy of the elements from index begin up to but EXCLUDING end; without end it runs to the end of the array. Negative indexes do NOT count from the end as in JS - they clamp to 0 - and bounds beyond the length clamp to the length; begin greater than end yields []. Example: [a,b,c,d] with begin 1, end 3 -> [b,c].

A typical wiring for slice: number feeds the begin pin; filter types feeds the array pin; the array out pin feeds match with any.

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

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.
  • filter types: feeds into this block. Returns an array of all items matching the selected type.
  • set fields: this block feeds into it. Generates an array of mutations based on the given filled fields.
  • get fields: feeds into this block. Gets the selected fields from the given object.
  • match with any: this block feeds into it.

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