compact_.compact(array)
Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "", undefined and NaN are all falsy.
1 2 | _.compact([0, 1, false , 2, '' , 3]); => [1, 2, 3] |
compact_.compact(array)
Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "", undefined and NaN are all falsy.
1 2 | _.compact([0, 1, false , 2, '' , 3]); => [1, 2, 3] |
Designed by : w10schools
service@w10schools.com
Please login to continue.