摘要:
let arr = ['刘德华','张学友','黎明','郭富城']; let arr2 = arr; arr = []; // 第一种方式 :这个是开辟一段新的空数组内存地址 arr.length = 0; // 第二种方式 :这个是将arr的内存地址清空 arr.splice(0); // 第三
阅读全文
posted @ 2022-02-08 11:42
Steven_YF
阅读(390)
推荐(0)
编辑
摘要:
let arr = ['a','b','c','d']; function move(arrs,from,to) { let arr1 = [...arrs]; let item = arr1.splice(from,1); arr1.splice(to,0,...item); return arr
阅读全文
posted @ 2022-02-08 11:27
Steven_YF
阅读(33)
推荐(0)
编辑