Returns the first index at which a given element can be found in the array, or -1 if the element is not present.
The array to search
The element to locate in the array
OptionalfromIndex: numberThe index to start the search from
The first index of the element, or -1 if not found
Joins all elements of an array into a string, using a specified delimiter between each element.
The array whose elements are to be joined
The string used to separate each element
A string with all array elements joined by the separator
Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards.
The array to search
The element to locate in the array
OptionalfromIndex: numberThe index at which to start searching backwards
The last index of the element, or -1 if not found
Returns a shallow copy of a portion of an array selected from the start index up to, but not including, the end index.
The array to slice
Optionalstart: numberThe beginning index of the slice (inclusive)
Optionalend: numberThe end index of the slice (exclusive); if omitted, slices to the end
A new array containing the extracted elements
Sorts the elements of an array in place and returns the sorted array. Supports ascending (default) and descending sort orders. Handles null/undefined values and uses locale-aware comparison for strings.
The array to sort
Optionalorder: "ASCENDING" | "DESCENDING" = 'ASCENDING'The sort order
The sorted array
Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place. Returns the array of removed elements.
The array to modify
The index at which to start changing the array
OptionaldeleteCount: numberThe number of elements to remove
Rest...items: any[]The elements to add at the start position
An array containing the removed elements
Provides functional transformations for arrays within HotMesh mapping rules. Although inspired by JavaScript, these methods have been adapted to follow a functional approach. Each transformation is a function that expects one or more input parameters from the prior row in the
@pipestructure.Remarks
Invoked via
{@array.<method>}in YAML mapping rules.