Function arrMapMutable

  • This function takes an array and a callback function as arguments. It applies the callback function to each element of the array, mutating the original array in the process.

    Type Parameters

    • T

      The type of elements in the input array.

    Parameters

    • input: T[]

      The array to be mapped over.

    • f: ArrayValueCallback<T>

      The callback function to be applied to each element of the array. This function takes three arguments: the current element, its index, and the original array.

    Returns T[]

    The original array, mutated by the callback function.

    Example

    arrMapMutable([1, 2, 3], (value: number) => value * 2);;
    //=> [2, 4, 6]

Generated using TypeDoc