Array.splice( index, remove_count, item_list )
Parameter: This method accepts many parameters some of which are described below:
- index: It is a required parameter. This parameter is the index from which the modification of the array starts (with the origin at 0). This can be negative also, which begins after many elements counting from the end.
- remove_count: The number of elements to be removed from the starting index.
- items_list: The list of new items separated by a comma operator that is to be inserted from the starting index.
Return Value: While it mutates the original array in place, still it returns the list of removed items. In case there is no removed array it returns an empty array.
Below are examples of Array splice() method.
HTML,CSS,JS,Bootstrap HTML,CSS,PHP,React_Native,Bootstrap JS HTML,CSS,PHP,React,React_Native,Bootstrap
C++,Java,Html,Python,C C++,Java,Julia,Php,Python,C Html C++,Java,Julia,Php,Pascal,Python,C
- Google Chrome 1 and above
- Internet Explorer 5.5 and above
- Firefox 1 and above
- Opera 4 and above
- Safari 1 and above