splice方法用来操作数组splice(startIndex,deleteNum,item1,....,)
此操作会改变原数组。
删除数组中元素

参数解释:startIndex为起始index索引。deleteNum为从startIndex索引位置开始需要删除的个数。
分三种情况:
没有传第三个参数的情况下,deleteNum不为0,表示的执行删除操作。
传第三个参数:分2种情况
第二个参数为0,表示执行的是插入操作。

第二个参数不为0,表示执行的是替换操作。

slice方法,可以用来操作数组、字符串
slice(startIndex,endIndex):表示从起始startIndex截取endIndex(但不包含endIndex索引位置元素)之间的内容。
此操作不改变原数组。
startIndex和endIndex参数同时都传入的情况。

只传入第一个参数startIndex

两个参数均不传

连个参数都不传的情况,拷贝的是原数组的副本,对于数组对象来说是浅拷贝。
