The easiest way is to use double negation syntax or Boolean
constructor
const str = "string"; const one = 1; const zero = 0; console.info(!!str, !!one, !!zero); //true, true, false console.info(Boolean(str), Boolean(one), Boolean(zero)); //true, true, false