Syntax | |
| |
start -- The position in the array where the slice is to begin. | |
delete -- The number of elements to be deleted from the array, beginning at the position specified by start. | |
arg3,...,argN -- New array elements to be inserted into the array, starting at the position specified by start. | |
Returns -- If any elements are deleted from the array, they are returned from the method as an array. | |
The splice() method can either add elements to or delete elements from an 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. | |
|