js remove falsey values from array code example
Example: js remove falsey values from array
const a =[3,,null, false, undefined, 1];
// Remove falsey
a.filter(Boolean);
// Remove specific (undefined)
a.filter(e => e !== undefined);
const a =[3,,null, false, undefined, 1];
// Remove falsey
a.filter(Boolean);
// Remove specific (undefined)
a.filter(e => e !== undefined);