The splice() function of array object adds and/or removes elements from an array and return array containing the deleted elements. Use it for example to add or remove element of existing array.
Syntax
This will produce following result