@vsokolov/utils - v0.32.0
    Preparing search index...

    Function replaceItemAtIndex

    • Replace an item at a given index

      Type Parameters

      • T

      Parameters

      • index: number | IndexCallback<T>

        An index or a callback provided to findIndex

      • newValue: T

        The value of the item to be replaced

      • Optionalarr: T[] | null

        The array to replace in

      Returns T[]

      New array with the item replaced