@nevware21/ts-utils
    Preparing search index...

    Function polyArrWith

    • Polyfill implementation of Array.with() for environments that don't support it.

      Type Parameters

      • T

        Identifies the type of array elements

      Parameters

      • theArray: ArrayLike<T>

        The array or array-like object to copy from

      • index: number

        The index at which to change the value

      • value: T

        The new value to set at the index

      Returns T[]

      A new array with the element at index replaced, every other index is read from theArray so an empty slot of a sparse array is undefined in the new array

      0.14.0

      RangeError if the index is out of bounds (so a value without a length, eg. a number, always throws), or the length is longer than an array can be (2^32 - 1), like the native function

      TypeError if theArray is null or undefined