Javascript Splice() Function

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

Javascript Splice() Function Example

This will produce following result