Professional Documents
Culture Documents
Arrays provide a lot of methods. To make things easier, in this chapter they are
split into groups.
Add/remove items
We already know methods that add and remove items from the beginning or the end:
splice
How to delete an element from the array?
That�s natural, because delete obj.key removes a value by the key. It�s all it
does. Fine for objects. But for arrays we usually want the rest of elements to
shift and occupy the freed place. We expect to have a shorter array now.