splice() - It is used to take elements out of an array and replace them with those specified. In the below example the element starting at element 3 is removed, two of them are removed and replaced with the specified strings. The value returned are those values that are replaced. This method is not defined so it must be written and included in your code.
Code:
words = new Array("limit","lines","finish","complete","In","Out")
words1 = words.splice(3, 2, "done", "On") The value of words becomes:
limit, lines, finish, done, On, Out
The value of words1 is set to:
complete, In