Skip to content

OutputNot attempted

Truthy or falsy?

console.log(!!'0', !!'', !![], !!{}, !!NaN, !!-0, !!0n, Boolean(new Boolean(false)));

Spaces and quote style don’t matter · write a thrown error as TypeError

Ctrl Enter
Show answer & explanation

The expected output comes from actually running the snippet; opening this shows it next to the explanation.

The 8 falsy values: false, 0, -0, 0n, "", null, undefined, NaN. Everything else is truthy, including "0", [], {} and the object new Boolean(false).