Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

splice Method (JavaScript)

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

arrayObj.splice(start, deleteCount, [item1[, item2[, . . . [,itemN]]]])
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.

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.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: Array Object (JavaScript)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.