current array
let arr = [
{id:1,Itemtype:true,name:""},
{id:2,Itemtype:false,name:""},
{id:3,Itemtype:true,name:""},
{id:4,Itemtype:false,name:""},
{id:5,Itemtype:false,name:""},
{id:6,Itemtype:true,name:""},
]
then I make a copy of this array
var copy = [];
for (var item in arr) {
copy[item] = arr[item];
}
for(var i=0;i<copy.length;iPP){
if(copy[i].Itemtype == true){
arrCopy.splice(i,1)//splicei,1true
}
}
log(copy);
only one has been deleted, but how do I delete all the attributes whose value is true?