compact
compact() -> newArray
Returns a new version of the array, without any null
/undefined
values.
Example
['frank', , 'sue', , 'sally', null].compact()
// -> ['frank', 'sue', 'sally']
compact() -> newArray
Returns a new version of the array, without any null
/undefined
values.
['frank', , 'sue', , 'sally', null].compact()
// -> ['frank', 'sue', 'sally']