Skip to content

Keyword array slice

Oliver Atkinson edited this page May 10, 2026 · 1 revision

array_slice

Returns a portion of an array.

Shape

{
  "{returns}": {
    "array_slice": {
      "of": [1, 2, 3, 4],
      "from": 1,
      "to": 3,
      "reversed": false
    }
  }
}
  • from defaults to the start.
  • to defaults to the end.
  • reversed reverses the source before slicing.
  • Bounds are clamped to the array.

Example

{
  "{returns}": {
    "array_slice": {
      "of": ["a", "b", "c", "d"],
      "from": 1,
      "to": 3
    }
  }
}

The result is ["b", "c"].

Clone this wiki locally