compactArraypublic
Returns a copy of the array with all null and undefined elements removed.
let arr = ['a', null, 'c', undefined]; arr.compact(); // ['a', 'c']
Returns:
-
Array - the array without null and undefined elements.
compactArraypublic
Returns a copy of the array with all null and undefined elements removed.
let arr = ['a', null, 'c', undefined]; arr.compact(); // ['a', 'c']
Array
Please login to continue.