---
title: "Discussion on \"Why 3 > 2 > 1 gives false\" | Hashnode"
description: "Discussion on \"Why 3 > 2 > 1 gives false\". Recently, I saw this question about how does Javascript evaluate an expression:\nhttps://twitter.com/GwagsiG/status/1303981215461105670?ref_src=twsrc%5Etfw\nSo, why does 1 < 2 < 3 give true, but 3 > 2 > 1 give false? According to operator precedence an..."
url: "https://hashnode.com/posts/why-3-greater-2-greater-1-gives-false/5f5cbff1ddc3fe5f4f24d06a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why 3 > 2 > 1 gives false](https://kahdev.hashnode.dev/why-3-greater-2-greater-1-gives-false?utm_source=hashnode&utm_medium=feed)

Recently, I saw this question about how does Javascript evaluate an expression: https://twitter.com/GwagsiG/status/1303981215461105670?ref\_src=twsrc%5Etfw So, why does 1 < 2 < 3 give true, but 3 > 2 > 1 give false? According to operator precedence an...

Sep 12, 2020 · 2 min read · kahdev.hashnode.dev  
Updated Dec 9, 2020  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Kah](https://hashnode.com/@kahdev)

@kahdev · Perth, Western Australia

  
[View profile](https://hashnode.com/@kahdev)

Software developer, runner and backyard chickens

Thanks to some friends, I started programming in high school with QBASIC. Nowadays, I'm a software engineer working mostly in Java and active on Exercism. On weekends, you can find me outside, at a parkrun, tending to the veggie patch or the six backyard chooks.

## Responses 1

Markdown supported · ⌘↵ to post

[Mark](https://hashnode.com/@mverleg)

[Sep 12, 2020](https://hashnode.com/posts/why-3-greater-2-greater-1-gives-false/5f5cbff1ddc3fe5f4f24d06a/comment/5f5cd57e13599a5f2e33f4e2)

Useful warning to prevent this pitfall!

Some languages like Python understand this syntax (so that `1 < 2 < 3` is the same as `1 < 2 and 2 < 3`). Many others give an error. I think Javascript's behaviour is an unfortunate mistake.
