Slice (start,end):
Parameters:
Start: Index of Start position
End: The index of the end position (but not the element that contains the index position)
For example:
Splice has the function of deleting, inserting, replacing
===================================================================
1: Removed features
Splice (Index,count)
Parameters:
Index: Indexing of the start position
Count: Number of elements to delete
Return: Returns the Array object that contains the deleted element
For example:
Results:
2: Insert function
Splice (index,0, inserted item)
Parameters
Index: The indexed value of the inserted element
For example:
3: Replace function
Splice (Index,num,value)
Index: the indexed position at which to start
Num: Deletes the number of items (if NUM is 0, which is the Insert function)
Value: Inserted values
Return: Returns the Array object that contains the element that was deleted
Results:
Summarize:
Slice: It's for interception.
Splice: is to do delete insert Replace with
Simple summary of Splice method and slice method in JS