How do I remove empty elements from an array in JavaScript?
Is there a straightforward way, or do I need to loop through it and remove them manually?
All the empty elements can be removed from an array by simply by using array.filter(String); It returns all non empty elements of an array in javascript
array.filter(String);