@theredhead — Frontend Library - v1.0.0
    Preparing search index...
    • Removes the item at fromIndex from source and inserts it into target at toIndex. Both arrays are mutated in place.

      Type Parameters

      • T

        The item type.

      Parameters

      • source: T[]

        The array to remove from.

      • fromIndex: number

        Zero-based index of the item to remove from source.

      • target: T[]

        The array to insert into.

      • toIndex: number

        Zero-based index at which to insert into target.

      Returns void

      const src = ['a', 'b', 'c'];
      const tgt = ['x', 'y'];
      moveItemToArray(src, 1, tgt, 1);
      // src → ['a', 'c']
      // tgt → ['x', 'b', 'y']