Splice ()
Features: Delete, insert and replace can be implemented.
Delete: You can delete any number of items by specifying only 2 parameters: the location of the first item to delete and the number of items to delete.
For example: Splice (0,2) deletes the first 2 items in the array.
Insert: You can insert any number of items to a specified location, providing only 3 parameters: The starting position, 0 (the item to be deleted), and the item to insert.
For example: Splice (2,0,11,12) Inserts 11 and 12 starting at position 2 of the current array.
Replace: You can insert any number of items at the specified location and delete any number of items at the same time by specifying 3 parameters: The starting position, the number of items to delete, and any number of items to insert. The number of items inserted does not have to be equal to the number of items deleted.
For example: Splice (2,1,4,6) deletes the item of the current array position 2, and then inserts 4 and 6 from position 2.
Jsの exercises-Arrays common methods-splice ()