-2

I have an Object of arrays.And its output looks like this. Object of array output

enter image description here

And code is like this

layer.fields.each(function(field) {
tr.append($('<th ></th>').text(field.name));
if(self.availableForTable.indexOf(field.name.toUpperCase()) != -1)
self.tblHeader.push(field.name);
});
tbody.append(tr);`

Now the issue is that I got some entries empty from database. like this like after 1 line 2nd line is empty.

enter image description here

Now how to remove this empty space. Is there any way in javascript for "Object of Array"?I searched on StackOverflow but didn't get any useful thing so far

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
F128115
  • 81
  • 1
  • 10

1 Answers1

0

To remove white spaces from array do like below:-

layer = layer.filter(function(entry) { return /\S/.test(entry); }); 
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98