What does console.log(!!'false', !!'0', Boolean('')) output?
A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-47.js
1console.log(!!'false',!!'0',Boolean(''))
Coercion
Answer & explanation
Console output
true true false
Why
String-to-boolean coercion only checks whether the string is empty. Every non-empty string is truthy, so the strings "false" and "0" both coerce to true even though their text suggests otherwise. Only the empty string "" is falsy. The six falsy values are: false, 0, "", null, undefined, and NaN.