Do you know what will be the output of this code?
JavaScript
console.log("10" < "9");
Show answer and explanation
The answer is true.
When both sides are strings, < compares them lexicographically, one character at a time. "1" has a lower character code than "9", so the comparison ends there.
Convert to numbers first: Number("10") < Number("9") is false.