// note: empty collections are not falsy like in python (empty array)
//note: will syntax error for 1x0n, 'false' is string here
const values = [false,'false','js', true, 0 , [],[1,2,3], 1, 'b', {}, '', NaN, undefined, null, -5,1n,0n,0x1n,0x0n];
//=> [ 'false', 'js', true, [], [ 1, 2, 3 ], 1, 'b', {}, -5, 1n, 1n ]
//=> [ 'false', 'js', true, [], [ 1, 2, 3 ], 1, 'b', {}, -5, null, null ] // BigInt not supported compilers
// double not
// first not makes it as boolean opposite values, then second not give its inversion
console.log(values.filter(
(value)=> !!value
));
// Auto Coercion
// values are self identified as falsy or not
console.log(values.filter(
value => value
));
// Boolean type conversion
// get values as parem and return boolean as falsy or not
console.log(values.filter(
(value)=> Boolean(value)
));
// Boolean constructor
// This works because Boolean itself is a function, and the arguments filter supplies are passed directly to it
console.log(values.filter(
Boolean
));