Falsy Check

node v18.11.0
version: 1.0.0
endpointsharetweet
const features = {} console.log(`undefined ${!features.foo ? 'block' : 'none'}`) features.foo = false console.log(`false ${!features.foo ? 'block' : 'none'}`) features.foo = "" console.log(`empty ${!features.foo ? 'block' : 'none'}`) features.foo = true console.log(`true ${!features.foo ? 'block' : 'none'}`) features.foo = {} console.log(`defined ${!features.foo ? 'block' : 'none'}`)
Loading…

no comments

    sign in to comment