Test case details

Preparation Code

<script> let array = [0, 1, false, 2, '', 3, null, 'a', undefined, NaN, 'b']; </script>

Test cases

Test #1

array.filter(Boolean);

Test #2

array.filter(value => !!value)