a useful function is to convert a value to boolean, something like this:
const toBool = x => not(not(x))
JavaScript already has the Boolean constructor which does what you're looking for: Boolean(x)
Boolean(x)
Most helpful comment
JavaScript already has the Boolean constructor which does what you're looking for:
Boolean(x)