Ruby Ruby Collections Ruby Arrays Removing Items From Arrays

.slice method is not removing elements from the original array

in the video the .slice method was mentioned correctly, that it return elements from the original array without deleting them from the main array, in the contrary, the .slice method was mentioned in the notes under the video, that it will also "remove" the elements from the main array, would you please correct it in the notes :)


1 Answer

The slice method takes two arguments and removes and returns items from the array. The first argument is the index in the array, and the second argument is the number of items:

Misty Smittle
Misty Smittle
7,225 Points

I am also seeing that slice returns but does not remove. I was also confused by the notes stating otherwise.