the following is a multi-dimensional array. How to get a new array after traversing and deleting the array with item and empty lists?
var arr = [{
id: 1,
name: 1,
item: [11,12,13,14],
lists:[17,18,18]
},{
id: 2,
name: 2,
item: [],
lists:[]
},{
id: 3,
name: 3,
item: [13,15,16,17,18],
lists:[]
},{
id: 4,
name: 4,
item: [],
lists:[]
},{
id: 5,
name: 5,
item: [13,15,16,17,18],
lists:[5,1,2,3]
}];
the new array you want is:
var arr = [{
id: 1,
name: 1,
item: [11,12,13,14],
lists:[17,18,18]
},{
id: 3,
name: 3,
item: [13,15,16,17,18],
lists:[]
},,{
id: 5,
name: 5,
item: [13,15,16,17,18],
lists:[5,1,2,3]
}];