JavaScript Comparison Logic
Ok JavaScript, 3 < 2 Isn’t this statement false? Yup 2 < 1 And this is false? Yup 3 < 2 < 1 So this must be false? That makes sense to me console.log(3<2<1); true
A JavaScript programmer presents increasingly confusing chained comparisons to Patrick Star, who agrees that the final expression is true. The joke is that JavaScript evaluates chained comparisons from left to right: 3 < 2 becomes false, and false is coerced to 0, making 0 < 1 true. EN: A JavaScript programmer presents increasingly confusing chained comparisons to Patrick Star, who agrees that the final expression is true. The joke is that JavaScript evaluates chained comparisons from left to right: 3 < 2 becomes false, and false is coerced to 0, making 0 < 1 true.
Patrick Star / Патрик СтарMermaid Man / Человек-русалкаblue-gloved hand / рука в синей перчаткеwhite card / белая карточкаcave / пещераrock wall / каменная стенаpink starfish / розовая морская звездаred superhero suit / красный супергеройский костюмblue mask / синяя маскаcomparison expression / выражение сравненияcomputer code / компьютерный кодtext caption / текстовая подпись
- @gentoomemes / 3084 2023-03-13
- Template
- Patrick Star Yup
- Type
- image
- Size
- 643×800 · 110.5 KiB
- Mood
- absurd, ironic
- Language
- en
- Added