splice Method (Windows Scripting - JScript)

 

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Syntax

arrayObj.splice(start, deleteCount, [item1[, item2[, . . . [,itemN]]]])

Arguments

  • arrayObj
    Required. An Array object.

  • start
    Required. The zero-based location in the array from which to start removing elements.

  • deleteCount
    Required. The number of elements to remove.

  • item1, item2,. . ., itemN
    Optional. Elements to insert into the array in place of the deleted elements.

Remarks

The splice method modifies arrayObj by removing the specified number of elements from position start and inserting new elements. The deleted elements are returned as a new array object.

Requirements

Version 5.5

Applies To: Array Object (Windows Scripting - JScript)

See Also

slice Method (Array) (Windows Scripting - JScript)