for(var i = arr.length - 1; i > -1; i--) { arr.splice(i, 1); } 转载于:https://www.cnblogs.com/tk900123/p/11118529.html