splice(start, length, ...values)

Replaces a length of values from a starting position with the given variadic values, and returns the values that were replaced as an array.

On collections

Usage

  • splice(start, length)
  • splice(start, length, ...values)

Related

  • swap(start, length, values?)

    Replaces a length of values from a starting position with the given values.

  • slice(start?, end?)

    Returns an array of the values contained in the half-open interval [start, end), that is, including the start and excluding the end.