Truthy & Falsy Values
What is the result of the expression: 'false' == false in JavaScript?
The expression 'false' == false evaluates to false in JavaScript. When comparing values of different types with the loose equality operator (==), JavaScript attempts to convert them to the same type before comparison. In this case, the boolean false is converted to a number (0), and the string 'false' is also attempted to be converted to a number. Since 'false' cannot be meaningfully converted to a number, it becomes NaN. And since NaN is not equal to any value (including itself), the comparison returns false. This demonstrates one of the many edge cases in JavaScript's type coercion system, and why many developers prefer to use the strict equality operator (===) which doesn't perform type conversion.