compact()
Create a new array or object with all of the false
-ish values removed.
arrOrObj
is an array or is array-like then an array will be returned. Otherwise an object will be returned. The returned array or object will be similar to arrOrObj
but will only have true
-ish values.This function directly requires the following function which is included automatically:
filter()