Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Sadly it accepts null while using Boolean removes it an empty strings. Commented Jun 10, 2020 at 14:18
  • 1
    @PaulWatson Yes unfortunately it accepts null as a string but can remove empty elements from array. Hope you understand Commented Jul 3, 2020 at 7:35
  • It doesn't even work well. It's supposed to remove "non-empty elements" (supposedly, existing elements, dropping all empty slots) but it also filters out an empty string and empty arrays. f it's supposed to filter out falsy values then it actually leaves in null and 0. Whichever way it's supposed to work it...doesn't. Especially if we consider anything that might have a custom toString() defined which can lead to further items considered falsy when they aren't. Commented Apr 22, 2021 at 17:35