Double bang

March 19, 2021 1 min read
const handler = "@telmo"
const name = null

// Before
console.log(handler ? true : false) // true
console.log(name ? true : false) // false

// After
console.log(!!handler) // true
console.log(!!name) // false