1. javascript 数据删除筛选
// 删除数据函数(用法太多了 自己体会呀 灵活运用啊) var DeleteData = ["1","3","5","6"]; var FilterArray = function (DataIndex) { DeleteData = filter_array(DeleteData); for (var i = 0; i < DeleteData.length; i++) { if (DeleteData[i] == DataIndex) { delete DeleteData[i]; } DeleteData = filter_array(DeleteData); } return DeleteData; } function filter_array(array) { return array.filter(item => item); } //示例 FilterArray("5"); //结果 1,3,6 5被过滤掉了