Filter truthy values in array
1 const arr = ['', 0, 1, 'true', false, Infinity, undefined, null, NaN, 12n, -0];
2 const truthy = arr.filter(Boolean); // [ 1, 'true', Infinity, 12n ]
1 const arr = ['', 0, 1, 'true', false, Infinity, undefined, null, NaN, 12n, -0];
2 const truthy = arr.filter(Boolean); // [ 1, 'true', Infinity, 12n ]