1. for (let i = a.length-1; i >= 0; i--) {
    2. if(a[i]===3){
    3. console.log(i);
    4. a.splice(i,1);
    5. }
    6. }
    7. console.log(a);//[0]
    1. const deps = {
    2. '采购部':[1,2,3],
    3. '人事部':[5,8,12],
    4. '行政部':[5,14,79],
    5. '运输部':[3,64,105],
    6. }
    7. let member = Object.values(deps).flat(Infinity);
    1. let hash = {};
    2. data = data.reduce((preVal, curVal) => {
    3. hash[curVal.id] ? '' : hash[curVal.id] = true && preVal.push(curVal);
    4. return preVal
    5. }, [])
    1. const array = JSON.parse(JSON.stringify(this.groupServiceListSearch));
    2. this.groupServiceList = array.filter(item => {
    3. item.groupServices = item.groupServices.filter(itemChild => {
    4. itemChild.items = itemChild.items.filter(res => res.name.includes(childName));
    5. return itemChild.items?.length > 0;
    6. });
    7. return item.groupServices?.length > 0;
    8. });