src code
Array#compact() → Array
Returns a copy of the array without any null or undefined values.
null
undefined