Search
The function compactArray should clear the array from all unnecessary elements, like false, undefined, empty strings, 0, and null.
compactArray
false
undefined
0
null
For example: