Do you mean the Answer: page, rather than the FAQ? If so, take another look at the text preceding the code... "The answers in the FAQ don't modify the array in-place. In case that's what you need, you can do the following: The splice is needed to modify the original array in-place.