I am getting array like below.
[{},
{},
{},
{ label: '2015', showLabels: '1,' },
{},
{},
{},
{ label: ‘2017’, showLabels: '1,' }]
but, I would like to delete empty indexes.
I have tried following to delete. But, Not working as expected.
const filteredFinalYearArr = yearArray.filter(function (el) {
return el != null;
});
Note: This is dynamic data
Any suggestions?