Skip to content

Instantly share code, notes, and snippets.

@omarkdev
Last active March 4, 2020 21:16
const falseExample = false;
const undefinedExample = undefined;
const nullExample = null;
const NaNExample = NaN;
const zeroExample = 0;
const stringExample = "";
console.log(!! falseExample, Boolean(falseExample), new Boolean(falseExample));
console.log(!! undefinedExample, Boolean(undefinedExample), new Boolean(undefinedExample));
console.log(!! nullExample, Boolean(nullExample), new Boolean(nullExample));
console.log(!! NaNExample, Boolean(NaNExample), new Boolean(NaNExample));
console.log(!! zeroExample, Boolean(zeroExample), new Boolean(zeroExample));
console.log(!! stringExample, Boolean(stringExample), new Boolean(stringExample));
// false false [Boolean: false]
// false false [Boolean: false]
// false false [Boolean: false]
// false false [Boolean: false]
// false false [Boolean: false]
// false false [Boolean: false]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment