How to remove empty elements from an array in JavaScript?
Originally posted here!
To remove empty, null, or undefined elements from an array, we can use the filter() array method and pass a function to the method which returns the element currently getting looped.
This method works because when an empty, n...
melvingeorge-me.hashnode.dev3 min read