let list = [1, 2, 3]
list.splice(0, list.length); // 方法一
// list.length = 0; // 方法二
console.log(list); // []
js 清空数组 的方法
猜你喜欢
转载自blog.csdn.net/qq_40015157/article/details/113869025
今日推荐
周排行