Array.splice()

JavaScript 1.2+ Nav4+ Syntax

							array.splice(start,delete,arg3,…,argN)

Description

The splice() method provides a way for elements to be either added to or deleted from the array. When the delete parameter contains a number other than zero, the elements beginning at start and ending at index start+ending are deleted from the array. If delete is zero, no elements are deleted. All elements from start to the end of the array are deleted when delete is not specified. If arguments follow the delete parameter, they are added to the array as elements beginning at the position specified by start. Existing elements are shifted up to allow room for the new elements.

Note

There is a bug in Navigator 4 when just one element is deleted ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.