这三个操作数组,哪个返回一个新数组呢.上代码 splice()方法,用于插入,删除和替换. var arr=[1,2,3,4,5]; var arr1=arr.splice(1,3); console.log(arr1);//[2,3,4] console.log(arr);//[1,5] 从结果可以看出来splice()改变了原来的数组. slice()方法,提取字符串某个部分,并返回. var arr=[1,2,3,4,5]; var arr2=arr.slice(1,3); console…
(1)数组和String对象都有slice()方法. //Array var list = ['A','B','C','D','DS']; console.log(list.slice(,));//截取后还是数组 //输出:["C", "D"] //String var str = 'ABCSDASD'; console.log(str.slice(,)); //输出:CS (2)splice方法 var a = [1,2,3,4,5], b = [1,2,3,4,…