To convert an integer to a boolean us Boolean() method
The boolean method converts integers with a value of zero to false and all other integers to true and returns the result.
console.log(Boolean(1));
// true
console.log(Boolean(0));
// false
console.log(Boolean(-0));
// true
console.log(Boolean(-1));
// false