Javascript
Apr 13, 2026
What is the output of both lines?
console.log(1 < 2 < 3)
console.log(3 > 2 > 1)
Explanation
Evaluated left to right: (1<2)=true, (true<3)=(1<3)=true. Second: (3>2)=true, (true>1)=(1>1)=false.
📝
Reviewed by CodeShot Editorial
Every challenge is code-reviewed by senior developers to ensure accuracy and real-world relevance. Learn more.