1.slice() 方法可從已有的數(shù)組中返回選定的元素
arrayObject.slice(start,end)

image.png
2.splice() 方法向/從數(shù)組中添加/刪除項(xiàng)目,然后返回被刪除的項(xiàng)目。
注釋?zhuān)?/strong>該方法會(huì)改變?cè)紨?shù)組。
arrayObject.splice(index,howmany,item1,.....,itemX)

image.png
arrayObject.slice(start,end)
注釋?zhuān)?/strong>該方法會(huì)改變?cè)紨?shù)組。
arrayObject.splice(index,howmany,item1,.....,itemX)