compactArray
public
Returns a copy of the array with all null
and undefined
elements removed.
1 2 | let arr = [ 'a' , null , 'c' , undefined]; arr.compact(); // ['a', 'c'] |
Returns:
-
Array
- the array without null and undefined elements.
compactArray
public
Defined in packages/ember-runtime/lib/mixins/enumerable.js:774
Returns a copy of the array with all null
and undefined
elements removed.
1 2 | let arr = [ 'a' , null , 'c' , undefined]; arr.compact(); // ['a', 'c'] |
Array
Designed by : w10schools
service@w10schools.com
Please login to continue.