Greater Than False

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A single line of JSX/JavaScript is dissected to reveal a subtle operator precedence bug. The expression `shouldNotShow === false > 0` evaluates in a non-obvious order: `false > 0` is evaluated first (due to `>` having higher precedence than `===`), then `===` compares `shouldNotShow` to that result, and finally `&&` combines it

2m read time From thedailywtf.com
Post cover image

Sort: