array.slice(start, {end})
array.slice(start, {end})slice returns a section of an array. start is the index to the beginning of the specified portion of the array. end is optional and is the index to the end of the specified portion of arrayObj. The slice method copies up to, but not including, the element indicated by end. If start is negative, it is treated as length+start where length is the length of the array. If end is negative, it is treated as length+end where length is the length of the array. If end is omitted, extraction continues to the end of arrayObj. If end occurs before start, no elements are copied to the new array.
array.splice(start, deleteCount, {item1{, item2{, ... {,itemN}}}})
array.splice(start, deleteCount, {item1{, item2{, ... {,itemN}}}})splice removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. start is the index from which to start removing elements. deleteCount is the number of elements to remove. item1,..., itemN are optional elements to insert into the array in place of the deleted elements.
The splice method modifies array by removing the specified number of elements from position start and inserting new elements. The deleted elements are returned as a new Array object.