Slice () is to create a new array (so you cannot
Array.slcie (1,4) Do you have to assign var a = Array.slice (1,4) to a variable like this? ), and the return value of this example is an array of 1 to 3 (No 4) entries splice () are operated on the original array, so it can be array.splice (1,4) or var a = Array.splice (1,4) but note that SPL The 1 meanings of 1 and slice (1,4) in ice (1,4) are the same, which means starting with an array index of 1, but 4 of splice () means the number of items to be deleted, while the 4 of Slice () represents the end of the previous, or 4, of the array index 3. The return values of slice () and splice () are all "cut" values. For Array.splice (2,0, "orange", "purple"), here the 2 can be expressed in the array index value 2 before the insertion, that is, the 3rd value of the array is inserted before, of course, it can be understood to be inserted after the 2nd value of the array, it is best to remember only one of them lest confuse
About the slice () and splice () Methods of arrays