for(let i=0;i<selectedGroup.children.length;i++){ let group = selectedGroup.children[i]; delete shapeList[group.myShapeIndex];//删除指定下标元素,不改变shapeList长度 } shapeList = shapeList.filter(Boolean);//清除数组中的空元素