I have an array of objects like this. The result is shown by console.log()
(5) [{…}, {…}, {…}, {…}, {…}]
0:
name:"SOMEVALUE"
partyDetails"SOMEVALUE"
__proto__:Object
1:
name: "SOMEVALUE"
partyDetails: "SOMEVALUE"
__proto__:Object
2:
name:"SOMEVALUE"
partyDetails: "SOMEVALUE"
__proto__: Object
3:
name:"SOMEVALUE"
partyDetails:"SOMEVALUE"
__proto__: Object
4:
name:"SOMEVALUE"
partyDetails: "SOMEVALUE"
__proto__:Object
length:5
__proto__:Array(0)
After deleting from the object by this command,
delete $scope.excelInfo.columnDefs[3];
delete $scope.excelInfo.columnDefs[4];
I get this on console.log
(5) [{…}, {…}, {…}, empty × 2]
0:
name:"SOMEVALUE"
partyDetails:"SOMEVALUE"
__proto__:Object
1:
name:"SOMEVALUE"
partyDetails:"SOMEVALUE"
__proto__:Object
2:
name:"SOMEVALUE"
partyDetails:"SOMEVALUE"
__proto__:Object
length:5
__proto__:Array(0)
How you see there are empty × 2 in the last array of objects, after delete.
What should I do to remove this 2 empty rows?
This 2 empty row make my data wrong in the view.
Is there any good solution?
I do not want to check if data equal to null.
Thanks a lot