JavaScript Array: slice vs splice