Edit This Page

splice(start, deleteCount)

Removes existing items of an Enumerable. This is the equivalent of Array.prototype.splice

Arguments

  • start (Number): start index
  • deleteCount (Number): number of items to remove

Returns

(Enumerable): New Enumerable with deleted items.

Example

Enumerable
        .from(['angel', 'clown', 'mandarin', 'surgeon'])
        .splice(2, 0)
        .toArray();
// []

Enumerable
        .from(['angel', 'clown', 'drum', 'mandarin', 'surgeon'])
        .splice(3, 1)
        .toArray();
// ['mandarin']