Skip to main content

Arrays & Objects


Splits input into an array at separator. separator can be an arbitrary string or regex pattern.

{split;one,two,three;,}          // {[one;two;three]}
{split;woah party tricks;/ +/g} // {[woah;party;tricks]}
{split;one,two,three;/(,)/g} // {[one;,;two;,;three]}, you can use groups to keep the separator in the output array.


Join the items of an array together with the given separator.

{join;{$array};,} // one,two,three

{push return?;array;value}

Adds an item to the end of an array.

This will mutate the original array, which is why nothing is returned by default.

{push;{$array};two} // no output
{$array} // {[one;two]}
{push return;{$array};three} // {[one;two;three]}


Returns and deletes the last item of an array.

{pop;{$array}} // three
{$array} // {[onw;two]}


Returns and deletes the first item of an array.

{shift;{$array}} // one
{$array} // {[two;three]}

{unshift return?;array;value}

Adds an item to the front of an array. Essentially the same as {push} but the item is added to the beginning of the array.

{unshift;{$array};two} // no output
{$array} // {[two;three]}
{unshift return;{$array};one} // {[one;two;three]}


This tag is part of the General expensive group.

Iterates over array items until {break} is encountered or it reaches the end of the array.


// regular format
{for;{=item};{$array};{$item}} // one two three

// block format


Get the keys of an object. Useful when you want to iterate over the keys or values of an object. Only top-level keys are returned

{keys;{$object}} // {[key;nested]}


Check whether an array includes an item.

{includes;{$array};two} // true

{sort reverse?;array;key?}

Sort an array. Returns a new array and does not mutate the original.

  • reverse? whether to reverse the array after sorting. Defaults to false.
  • array the array to sort
  • key the key to sort by if the array is an array of objects.


Get a slice of an array or string. If end is not specified, it is assumed to be the length of the target.

{slice;{$array};1} // {[two;three]}
{slice;{$array};1;2} // {[two]}

{index mode?;array;value}

Return the index at which a given element can be found in the array. Defaults to the first instance.

  • mode? an option mode for indexing the array. Can be last or all.
  • array the array to index
  • value the value to look for


Return an array with just the elements that pass a check.

  • array the array to filter
  • value the value to filter by
  • operator the operator to filter by
  • key the key to filter by if the array is an array of objects.

The available operators are ==, ===, !=, !==, >, >=, <, <=, startswith, endswith, contains, includes, has and matches.


Combines two or more arrays into one.


{splice;{$first_array};{$second_array}} // {[one;two;three;four;five;six]}