I have an array of object, I want to remove entire object from the array whose value is 1 using splice.I have an array of object, I want to remove entire object from the array whose value is 1 using splice. Here is the code:
<!DOCTYPE html>
<html>
<body>
<script>
const CellDisplay = item => {
switch (item) {
case 'item1':
return 'one';
case 'item2':
return 'two';
case 'item3':
return 'three';
case 'item4':
return 'four';
case 'item5':
return 'five';
}
};
const forLaunch = lData => {
for (const key in lData) {
console.log(key);
return CellDisplay(key);
}
}
const Obj = [{
Id: 575,
items: {
item1: '2020-12-08T10:00:00.000+0000',
item2: '2020-11-12T00:00:00.000+0000',
item3: '2020-12-08T10:00:00.000+0000',
item4: null,
item5: '2020-12-08T10:00:00.000+0000'
},
active: false
}];
Obj.forEach(data => {
forLaunch(data.items);
});
</script>
</html>